Home   Help Search Login Register  

Author Topic: playMove and addAction  (Read 1644 times)

0 Members and 1 Guest are viewing this topic.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
playMove and addAction
« on: 01 Jun 2008, 01:42:06 »
I want to have a player get a action, and when he uses it, I want him to do an animation (via playMove). Any good way of making it so all units see him do this action?

Problem is that many players might use the same action at the same time, and therefor I can't use global variables and pV them.

Now I'm running a script globally, and when the player uses the action, he gets a lot added to his rating. Since this is global, the script running globally checks for this high rating and then plays the animation. But I would rather do it in a better way...

Offline Gcfungus

  • Members
  • *
Re: playMove and addAction
« Reply #1 on: 01 Jun 2008, 09:46:36 »
I'm not sure about the global and local things, but I can try and help you with the addaction.
I don't know if you've already checked the COMREF, but this is some helpful stuff from the addaction:

Quote from: Toadlife
It seems that since 1.85+(?) addAction has correctly returned action ID.

Params passed by an action to the executed script:
[(object action was attached to), (unit that activated action), (index of action)]

So an example of an action-based script goes like this:

_obj = _this select 0
_man = _this select 1
_index = _this select 2

If you want to remove the action from the object immediately after it's triggered, use this line along with the above:

_obj removeAction _index
You could use the second param passed to check who's activated the script, regardless of who it's attatched to.
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: playMove and addAction
« Reply #2 on: 01 Jun 2008, 12:10:31 »
Yeah I've got the addAction set up properly. Problem is getting from what I write in the script run by addAction to playing the animation on all clients :confused:

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: playMove and addAction
« Reply #3 on: 03 Jun 2008, 16:49:41 »
CoC NS2. You can do what you need with a single line of code.
« Last Edit: 03 Jun 2008, 16:51:55 by Mr.Peanut »
urp!