Game Development Community

Switching Datablocks on the fly?

by Arian Goodwin · in Torque Game Engine · 02/14/2005 (11:57 am) · 5 replies

So you can switch datablocks for an object on the fly i hear?

Here's the context: I'm trying to cause a player to freeze for a few seconds when hit by a special weapon. I don't have the source code (YET) so making additions there is out for me.

Can anyone tell me how to switch the datablock, hopefuly with a little example? And would this work as I hope it would, causing the client's player to react to the new values?

If not, is there any other way to accomplish changes to values that don't have specific Player functions to set them (such as damage) WITHOUT altering the source code?

Thanks all

#1
02/14/2005 (12:03 pm)
The search function, it is your friend!

This thread discussed this quite some time back, but you can still easily find it by searching. Inside there should be at least 2 ways of doing what you wanted, I've only tested one.

It's not hard to switch datablocks, as far as I have tested. Good luck :)
#2
02/16/2005 (10:23 am)
I am currently not a Torque owner, but I will be by the time I get my next financial aid (I'm creating a FPS with two other students as my capstone project). I'm using 3D game programming all in one, and one of my partners owns the source code....

In other words, I don't have access to this thread. Perhaps someone wouldn't mind copying and pasting?
#3
02/17/2005 (12:31 pm)
Could you create a kind of "state" system based on event calls in the player script? For instance, if a state event comes that the player is "frozen" you'd lock up input until another state event comes that the player "thawed."

I'm just tossing out guesses, but it seems that switching datablocks is cumbersome for this type of dynamic behavior, especially if you consider combinations of them.
#4
02/21/2005 (8:57 am)
Hey Thanks Jason... that seems like it would work well, just taking the movement keys away from the player for a few.

I'm still hoping someone could possibly post an example (of switching datablocks in game) keeping in mind I don't have access to the private owner forums yet... Also, someone mentioned to me what you guessed Jason, that they thought it might not be something possible to do in game smoothly. Anyone else that could testify to whether this is true?

Mostly just hoping for a quick and dirty example of how this could be done. It still would be useful for some things even if it causes a major reload of data.
#5
02/22/2005 (1:44 pm)
Any1?