Passing vars to PathManager
by Novack · in RTS Starter Kit · 08/05/2007 (5:10 pm) · 6 replies
I want to know all the selected units from PathManager. So, I want to pass %client (or some variable) to the PathManager::getNextWaypoint function through Player::onReachDestination (that last one doesnt have %client by default, I would pass it as well).
BUT, onReachDestination is looped (by Torque design), and the second time is called it looses the param values. As a result, my chain is broken and I cannot pass %client (or any other var than Player) to PathManager.
The only solution is the creation of a global variable? I already try GetControllingObject() and GetControllingClient() but both returns 0. Any ideas?
BUT, onReachDestination is looped (by Torque design), and the second time is called it looses the param values. As a result, my chain is broken and I cannot pass %client (or any other var than Player) to PathManager.
The only solution is the creation of a global variable? I already try GetControllingObject() and GetControllingClient() but both returns 0. Any ideas?
About the author
http://cyberiansoftware.com.ar/
#2
Ill check it tonight, thanks, Ill post later about the results.
08/06/2007 (7:53 am)
Wow... thats just... a miracle! :DIll check it tonight, thanks, Ill post later about the results.
#3
08/06/2007 (4:02 pm)
Well man, that works, thank you!
#4
08/07/2007 (10:42 am)
Cool! Glad to hear it.
#5
%rtsunit.client = %client
doesnt really change its client, i think, unlike
%rtsunit.setControllingConnection(%client);
which does.
08/08/2007 (11:12 am)
It think its %rtsunit.getControllingConnection(); in the rts starter kit. If not its %rtsunit.getControllingClient();I would rely on the code variable instead of the one assigned in the script.%rtsunit.client = %client
doesnt really change its client, i think, unlike
%rtsunit.setControllingConnection(%client);
which does.
#6
There is some similar way to know in wich simsets and/or simgroups the unit is (from the unit)?
08/10/2007 (7:45 am)
Mhh good info.There is some similar way to know in wich simsets and/or simgroups the unit is (from the unit)?
Torque Owner Swarthmore College (#0007)