Home   Help Search Login Register  

Author Topic: release script doesn't work on dedicated server  (Read 1574 times)

0 Members and 1 Guest are viewing this topic.

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
release script doesn't work on dedicated server
« on: 08 Oct 2008, 09:24:30 »
I have problems with that  mission: http://www.ofpec.com/forum/index.php?topic=32131.0

You have to release 3 prisoners plus civilians...
Played on a dedicated server, I can release only one prisoner (karl), the 2 others and the civilians don't move... I don't understand, the scripts are very similar and are working well on a public server... :dunno:
Perhaps will it be too long to put the scripts in the post to compare them... tell me if you need them or if you can download and unpbo the mission...
Thanks!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: release script doesn't work on dedicated server
« Reply #1 on: 08 Oct 2008, 14:26:07 »
Donwload and unpbo a mission to analyze a script????  :blink: :blink: :blink:

Anyway, might be you have a locality problem. These captives are local to the server, but the action is executed by a player. Many commands require that the affected unit must be local, so if you execute these commands from your "release" action script (executed client side - by a player) they will have no effect on units that are local on a different PC (the server). Probably this is the case of switchMove, playMove and/or serCaptive.

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: release script doesn't work on dedicated server
« Reply #2 on: 08 Oct 2008, 19:02:16 »
Quote
Donwload and unpbo a mission to analyze a script?
Excuse-me... I knew it was silly, but I was fed up with that problem...
effectively, there is a switchmove command in the script...
in the unit field of the unit, there is:
Code: [Select]
[this] exec "hostages\set_captivecivil.sqs"(Do I have to move that command in the init file of the mission?)

Code: [Select]
_hostage = _this select 0
_hostage setCaptive true
_hostage switchMove "AmovPercMstpSsurWnonDnon"
_hostage setBehaviour "SAFE"
_hostage addAction ["Release civilian", "hostages\ok_freecivil.sqs"]
_hostage addEventHandler ["killed", {_this exec "hostages\set_dead.sqs"}]
_hostage disableAI "anim"
removeAllWeapons _hostage
the "Release civilian" action by the player then calls a small script:

Code: [Select]
freecivilok=true;
publicVariable "freecivilok";

then a trigger with condition "freecivilok" and on activation: [p1] exec "hostages\set_freecivil.sqs"
here is that script:
Code: [Select]
_player = player
_hostage = _this select 0

?!(alive _hostage):exit
?!(alive _player):exit
_hostage enableAI "anim"
_hostage setCaptive false
_hostage playMove ""
_hostage setBehaviour "safe"
_hostage removeAction 0
exit

I think that civils and prisoners are released, but not setcaptive false or enable to playmove"" (but one with a similar script!)
Help!
I like the mission and I wish it could be playable on dedi servers too... what can I do?
« Last Edit: 08 Oct 2008, 19:05:13 by fleepee »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: release script doesn't work on dedicated server
« Reply #3 on: 08 Oct 2008, 20:06:00 »
I see, on a dedi server there is no player so
?!(alive _player):exit <- Will be executed always
Where the players are alive the AI units are not local, so the code affecting them will have no effect.
Where the player is not alive (dedi server) the units are local, but you exit the script because of the previous condition.

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: release script doesn't work on dedicated server
« Reply #4 on: 08 Oct 2008, 20:28:20 »
 :good:
OK!!!!
Thanks a lot!
That was simple, but that's a luck that there are such guys like you with your knowledge!!
Thanks again!