OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: laggy on 05 Dec 2008, 21:32:49

Title: Simple action scripts and radio triggers not working on dedi server.
Post by: laggy on 05 Dec 2008, 21:32:49
Hi,

In a MP mission that I'm testing on a dedi server I have an extremely simple action script that don't seem to work. I have no idea why.
I also have some problems with radio triggers. Everything of course works perfectly in SP.

ACTION PROBLEM:

Init.sqs:
inteltaken = false

Trigger1:
Repetedly
Condition: player distance guy < 2 AND ! (inteltaken)
OnActivation: grab = player addaction ["Take Intel Files", "intel.sqs"]
OnDeactivation: player removeaction grab

intel.sqs:
inteltaken = true
publicVariable "inteltaken"
exit

Trigger2:
Once
Condition: inteltaken
OnActivation: "1" objStatus "DONE"; leader heroes sideradio "shortradio"; leader heroes sidechat "Intel Files taken."

heroes is the only players group defined in leaders (playable unit) init line.

Effect:

The action appears in dedi MP and dissapears if not used and when the distance exceeds 2m. But when used/pushed does not dissappear or start Trigger2 that has "1" objstatus "DONE" and the radio sounds. I have no idea why.


RADIO TRIGGER PROBLEM:

A remote group is called decoy (defined in leaders init line) and the leading unit is a tank.

Radio Alpha Trigger:
Repetedly
OnActivation: decoy move decoymoveposition; leader decoy sideradio "shortradio"; leader decoy sidechat "Moving into position"

(decoymoveposition is defined through onMapSingleClick and publicVariable'd every time)

Effect:

The decoy group moves to the right position but no messages are shown or heard. I don't understand.


Please help.

Laggy
Title: Re: Simple action scripts and radio triggers not working on dedi server.
Post by: Ext3rmin4tor on 10 Dec 2008, 13:44:57
If you want to make the action disappear after executing the script you must remove it writing

player removeAction grab

The error on displaying the messages might be due to the fact that you didn't broadcast the group variable over the network. Is the group variable public (i.e. did you use publicVariable to broadcast it)? If not in singleplayer it works because the player is also the host and then he has access to variables on his machine (in singleplayer you're the host of your game) otherwise you will see nothing because the game neeeds access to a variable which is not on that computer (that is, the group variable). Thus, "leader heroes" is a null variable and the command doesn't work properly.

SUGGESTION: Since "heroes" is the group of the playable units why don't you use "leader player" instead of "leader heroes"?