Caba`drin said:Patta said:Any way to use "add_visitors_to_current_scene" in the following way:
Let a bot appear at the position of the player who pressed a key. For example i put it onto key "h", so when someone presses it, a bot spawns next to him. Spawning a bot in general is no problem, i made it that the bot is in the right team and so on (multiplayer) but i have a problem with making the bot spawn at the players position. I would like to use "add_visitors_to_current_scene" if posssible, i dont like "spawn_agent" very much.
On the key press trigger, mark that this spawn call has been made with a slot or a global variable, likely storing the player's id or some such. Then, use add_visitors_to_current_scene to spawn new agents. If you do the above in a conditions block, then have a few second delay before the consequences block, where you clear the slot/global.
Then, use a ti_on_agent_spawn trigger with a check for the spawn call variable/slot in the conditions block. In the consequences, do what you need to do to move the agent to the player's position.
Except the thing with resetting the variable, it seems like i got everything. Seems to work, too. Only the variable does not reset. Can you tell me how excatly i shall do that? thx.
Also, i have another question: How can i limit a class to one, so that only one player can take it per team? And is it possible to make it so that this troop (one per faction) is not able to take more then one weapon? So that weapon slots 2-4 are blocked for this class?