Jump to content
Sign in to follow this  
Fangie

Scripting problem

Recommended Posts

I want to make a multiplayer mission that has only real players on your team, so no AI players. I could not find a command which checks wether a unit is player or AI controlled, so I've come up with an idea. I tell in the script to stop the unit, and then i check wether the unit is on stopped modus. I think this only works on AI, so I can flush the real players from the AI, and then I delete the AI units. One problem: the script can't check if a unit is in stopped modus. Here I'll show you the script I've made.

unitdel = "AI unit deleted"

man2 stop true

? (man2 stop) : (me groupchat unitdel)

Exit

me is the player unit, i'm currently commanding, of course in multiplayer, this unit would be playable.

man2 is the current AI test unit.

I use unitdel to check wether the script does his job.

I hope someone can help me, other ideas on checking wether a unit is AI or player are welcome, nevertheless, it would be interesting to know how to check these sort of commands, because man2 disableAI "move" didn't work either.

Share this post


Link to post
Share on other sites

I don't know the answer to your question in detail, but you should m_search.gif a little more.

I believe you can just deleteVehicle everyone as active Players do not get deleted.

EDIT: doh, it's xmas time xmas.gifxmas.gif

Share this post


Link to post
Share on other sites

Thanks bn880, that's just what i'm looking for, still, it would be interesting, if you could check if a unit is busy doing something or check wether he is in some kind of modus.

Share this post


Link to post
Share on other sites

There is a command called "unitready" which returns a true or false value depending on whether the unit is busy or not. Like:

?! (unitready unit) : deletevehicle unit

You can also use "speed" to tell how fast a unit is moving, and "speedmode" to see what speed mode it is using (limited, normal, or full). Finally, there's the "behaviour" command which tells if the unit is Careless, Safe, Aware, Combat or Stealth.

Dunno of anymore at the moment. smile.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×