Home   Help Search Login Register  

Author Topic: Action-menu actions  (Read 1397 times)

0 Members and 2 Guests are viewing this topic.

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Action-menu actions
« on: 09 Apr 2003, 17:18:17 »
I've got three questions:

1. Some soliders in my multiplayer mission have user-actions I've added with "addAction". If this soldier dies he respawns, but he loses this extra action.
How do you keep added action after respawn?


2. In this mission I have also added a "join" and "Unjoin" action to make the players able to join with the nearest AI-player.
If I'm on the server and joins with a tank, asks it to go somewhere and then "unjoins", the tank continues to the place I ordered it to go. BUT if I am on a client doing the same, the tank stops immediatly when I "unjoin".
How can I make the AI continue performing their last action even if I "unjoin" on the client?

3. When two players get near each other, both of them get TWO join and TWO unjoin actions (His own and the other players). I've fixed this so that the "wrong" one of the two doesn't work, but it's still there and it's UGLY!
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

Tactician

  • Guest
Re:Action-menu actions
« Reply #1 on: 10 Apr 2003, 01:17:35 »
I think you could fix some of these problems by using a different approach to adding actions.  For example, say you want the player to have an action to stab a certain civilian (civ1) when he gets close.  Don't use addAction from the init field, instead:

Trigger activated repeatedly.
Condition: player distance civ1 < 5 AND alive civ1 AND vehicle player == player
Activation: stabHim = player addAction ["Stab civilian","stab.sqs"]
DeActivation: player removeAction stabHim

So the player would receive an action when 5 meters away from the civilian that goes away when he leaves.  He won't receive the action unless he's on foot (not in a vehicle).

The above method might be sort of limited for what you're doing, but think about using the "player" var to avoid duplicate actions.

Rappy

  • Guest
Re:Action-menu actions
« Reply #2 on: 11 Apr 2003, 17:57:17 »
Or have a loopscript

#loop
@!(alive player1): goto "respawn"
goto "loop"

#respawn
;; wait depends on how long it will take for the player to respawn
~5
player1 addaction ["blow up", "blowup.sqs"]
;; you can also use this to restock player with weapons, etc
goto "loop"