Game Development Community

Using Con::setLocalVariable ...

by Jeremy Alessi · in Torque Game Engine · 09/06/2006 (1:33 am) · 4 replies

I'm trying to use a trigger for a new move in order to then set a variable in script %obj.client.player.attackType. Essentially, I want to use a trigger to make sure it arrives as soon as possible. I don't know what the latency on a CommandToServer is vs. a move->Trigger[] but if it's significant as I've been led to believe then this should ensure that the move gets processed appropriately ahead of the curve. Can I set script objects' members like this? So far it seems I cannot.

#1
09/06/2006 (10:23 am)
Yes, triggers are the fastest type of data sending, because move packets go out with the highest priority in every packet. But why are you doing that from C++? Just set it in the Player::onTrigger method in script when you get the trigger you're looking for.
#2
09/06/2006 (11:07 am)
Why are the other move managed triggers in the C++ code? I was simply following up on the jump code etc... whcih use the triggers. If this works with the same speed then I'm fine with that. Thanks!
#3
09/06/2006 (11:25 am)
I'm pretty sure the script callback is going to be called wherever the triggers are handled in C++, so it's probably fine. The jump trigger is handled in C++ coz' it affects the physics calcs, but I don't see any reason why the trigger[0/1]'s that activate the mounted images _need_ to be in C++. They probably just are coz' it's a very easy call to make in C++ and very standard for an FPS character. I've written extra behaviors in the script onTrigger callback (like a grenade toss key) and it seems to work fine.
#4
09/06/2006 (12:30 pm)
I got it working hopefully it's faster than a commandToServer. Thanks for the tip!