Home   Help Search Login Register  

Author Topic: Probs with action commands  (Read 2310 times)

0 Members and 1 Guest are viewing this topic.

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Probs with action commands
« on: 10 Sep 2002, 17:47:07 »
Hi, I've got a little problem with adding action commands. I know how to add the commands like this: 'ActionName = aP AddAction ["text", "script"]', howerver, I would like the command only to appear for one guy in the game. When I add an action command in the mission every player (it's a multiplayer mission) in the game can use it. Plz help thx.  :)
Weeee...

seanver

  • Guest
Re:Probs with action commands
« Reply #1 on: 10 Sep 2002, 20:02:30 »
Better ask it at Editing/Scripting: Multiplayer forum.

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Re:Probs with action commands
« Reply #2 on: 10 Sep 2002, 21:40:00 »
Perhaps, but the same prob occurs in single player so that really isn't the issue...
Weeee...

seanver

  • Guest
Re:Probs with action commands
« Reply #3 on: 10 Sep 2002, 22:34:31 »
Quote
When I add an action command in the mission every player (it's a multiplayer mission) in the game can use it

In a single player mission it is impossible that "every player" in the game can use the action menu since there's only player. So am I missing something?  ???

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Probs with action commands
« Reply #4 on: 11 Sep 2002, 03:32:25 »
Welcome to the forums, Wildebeest

When you use a user added action (ie. when the player clicks on it) it actually passes two variables to the script.
These variables are:
  • The unit/object the action was assigned to
  • The unit that activated the action
So, using a line like this:

? (_this select 1) != aP: exit

You could make the script exit if any unit besides aP activates the action.

Other players could still click the action, but the script won't activate for them...

That's the best thing I can think of... as far as I know there is no way of making it so the action doesn't show up unless you are a specific player. Unless you remove the action if another player is near... but that means aP won't be able to use it either...

Anyway, hopefully that will help you out a bit ;)

[edit]I can barely type with dese fdat fingers ;D[/edit]
« Last Edit: 11 Sep 2002, 03:36:27 by Sui »

Backoff

  • Guest
Re:Probs with action commands
« Reply #5 on: 11 Sep 2002, 13:00:29 »
Hello,

In fact the script used with addaction will have THREE params passed. The two first are, as Sui nicely said, the object id on which the action was added, the player id who used the action and third the action id (the id returned with the addaction command, which is really useful).

That was for the precisions  ;)

As for the problem where other players can see the action of a specific player (wich is a normal effect in the game), you can check the player id before adding the action:

?(Player == MyPlayer): _act = MyPlayer addaction ["blabla","blabla.sqs"];

this way, only MyPlayer will have the action effectivly added.

Happy editing  8)
« Last Edit: 11 Sep 2002, 13:01:10 by Backoff »