Home   Help Search Login Register  

Author Topic: Script Issue on Dedicated Server  (Read 10782 times)

0 Members and 1 Guest are viewing this topic.

Offline Case

  • Members
  • *
Script Issue on Dedicated Server
« on: 04 Sep 2007, 05:05:15 »
I finished a mission and had been testing it all along using the 'interactive' server (non-dedicated).  It works fine on that.  I now try to run the mission on a dedicated server and am having problems. 

It is at the very start of the mission, you start at an airbase and need to board two MH-6's.  Once aboard, I have two radio commands 'Insert Alpha', and 'Insert Bravo'.  Each of these radio triggers call a script.  Here is the content of the 'Alpha' script:

Code: [Select]
hint ""
hint "INSIDE alpha"
? (!isServer): exit

setfire=true
onMapSingleClick "AlphaTarget setpos _pos; setfire=false"

@!setfire
"AlphaInsertion" setmarkerpos getpos AlphaTarget
; onMapSingleClick ""

#Start
_markerobj = createMarker["Alpha", getpos AlphaTarget]
_markerobj setMarkerShape "ICON"
"Alpha" setMarkerType "DOT"
"Alpha" setMarkerText "Alpha Insertion"

driver MH6_1 flyinheight 50
driver MH6_1 domove getpos AlphaTarget
driver MH6_1 setspeedMode "Full"

#Insert
~1
? (MH6_1 distance AlphaTarget) < 500 : goto "Approach"
hint format ["%1",MH6_1 distance AlphaTarget]
goto "Insert"

#Approach
MH6_1 SetSpeedMode "Limited"
MH6_1 sidechat "Alpha team! Get ready boys, approaching insertion point"

#loop
~1
? not (unitready driver MH6_1):goto "loop"
MH6_1 sidechat "Alpha team! Get ready for quick deployment"
~3
MH6_1 land "GET OUT"


#loop3
_numcrew = count crew MH6_1
? _numcrew > 1: goto "loop3"
~1
[driver _MH6] join grpNull
MH6_1 domove getpos rtb_Alpha
MH6_1 SetSpeedMode "Normal"
MH6_1 flyinheight 50
#RTB
~1
? (MH6_1 distance rtb_Alpha) < 400 : goto "RTB_Approach"
goto "RTB"

#RTB_Approach
MH6_1 SetSpeedMode "Limited"

#RTB_loop
~1
? not (unitready driver MH6_1):goto "RTB_loop"
~3
MH6_1 land "LAND"
deleteMarker Alpha
~40
MH6_1 setFuel 0

#End
#Exit


I know it enters the script, because I get the hint 'inside' that I added for debugging.  When you click on the map, an icon should appear and the heli takes off.  This doesn't happen.

Does anyone have any ideas?

If you want to take a closer at the mission and scripts, I have the entire mission zipped up here:   http://www.rowlinson.ca/arma/c9_preemptive_action.zip

Cheers!!

« Last Edit: 04 Sep 2007, 22:57:13 by Case »

Offline Nixer6

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #1 on: 04 Sep 2007, 09:16:41 »
Not much help here but............have you tried just executing the script on the server?

Code: [Select]
? (!isServer): exit
Just a thought as I am having LOTS of problems with MP scripting myself.
Why do I have to be a Rocket Scientist to make a good mission?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #2 on: 04 Sep 2007, 11:31:03 »
Code: [Select]
_numcrew = count crew _MH6 ->
Code: [Select]
_numcrew = count crew MH6_1
Code: [Select]
? not (unitready _MH6):goto "loop" ->
Code: [Select]
? not (unitready driver MH6_1):goto "loop"
You may find another problem, ArmA stalls trying to solve long range paths for vehicles, so you may click a point on the other side of the island and the chopper will refuse to move.

Probably you should add more checks for damage level of the chopper as well as checking that the driver is inside the chopper (he might eject, so he will be ready, the chopper will be ready, but the destination has not been reached).

Offline Case

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #3 on: 04 Sep 2007, 16:50:19 »
Nixer, thanks I will try that and report back.

Mandoble, I am actually just recently aware of the pathing issue.  During playtesting of this mission though, I have never had a problem with this, the places where you would want to insert your teams seem to work just fine for pathing.  Last night I even tested this trying to click on the map only about 700m away, and still no luck.  Also, your suggestions about the other checks are good, thanks for that.

Cheers!

EDIT:  I just finished testing using the 'run only on server' fix from Nixer.  Still the same problem.   Mandoble, I cleaned up those coding errors.  During troubleshooting of this problem, I had separated out my 'insertion' script from getting passed the heli, to having a hard-coded alpha and bravo script.  Just FYI.

Anyway, I am still stuck here, so let me know if anyone has any other suggestions.  Thanks!
« Last Edit: 04 Sep 2007, 17:23:25 by Case »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #4 on: 04 Sep 2007, 20:13:12 »
May you update first post with the resulting code after your last modifications?

Offline Case

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #5 on: 04 Sep 2007, 21:13:53 »
Updated script in this post.  I also updated the zip file of the mission available to download in the first post's link.


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #6 on: 04 Sep 2007, 22:25:03 »
_markerobj = createMarker["Alpha", AlphaTarget]

AlphaTarget is a position or an object? If an object, you are missing getPos there.

MH6_1 domove getpos AlphaTarget
MH6_1 flyinheight 50
MH6_1 setspeedMode "Full"

->
MH6_1 flyinheight 50
driver MH6_1 domove getpos AlphaTarget
driver MH6_1 setspeedMode "Full"

or ->
MH6_1 flyinheight 50
driver MH6_1 domove getpos AlphaTarget
group driver MH6_1 setspeedMode "Full"


Offline Case

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #7 on: 04 Sep 2007, 22:38:18 »
To be honest, I am not totally sure.  The original first mention of 'alphatarget' is in the onmapsingle click call which I plagiarized from someone's else script.

I will update the script with your changes though, and try again under dedicated server, this is all working fine using 'regular' server.

Thanks again.

EDIT:  Same problem.  Clicking on the map doesn't place a marker, and the heli's never leave.  I am updating the script to reflect the latest version.
« Last Edit: 04 Sep 2007, 22:56:34 by Case »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #8 on: 04 Sep 2007, 23:04:30 »
Does AlphaTarget exist? it seems to be an object already placed on the map, more than problably a gamelogic named that way.

Offline Case

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #9 on: 04 Sep 2007, 23:07:11 »
Ooops,

Yes, it does.  Sorry about that, been so long since I first created it.

It exists as one of the Invisible 'H' heli pads.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #10 on: 04 Sep 2007, 23:11:18 »
Add a hint format ["%1", getpos AlphaTarget] just after @!setfire and check that you get the hint and coordinates inside the map.


Offline Case

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #11 on: 04 Sep 2007, 23:50:47 »
Ok,

Just tested.

On non-dedicated server, I got the coords displayed in hint, and then everything else worked (like usual).

Dedicated server:  coords displayed, then nothing else happened (ie. No marker created, heli doesn't take off).

Could the 'setmarkerpos' command be 'breaking' on the dedicated server?  Am I calling it wrong?


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #12 on: 05 Sep 2007, 00:03:54 »
On a dedicated server this will never work.
? (!isServer): exit
the dedicated server has no player, so no one will activate the map single click and no marker will be created, etc.
Are you executing this script from a trigger?

Offline Case

  • Members
  • *
Re: Script Issue on Dedicated Server
« Reply #13 on: 05 Sep 2007, 00:08:10 »
Ok, good to know, I will remember that.

I actually have that line commented out since right after I confirmed it didn't fix anything for me.

This script is being called from a radio activation trigger.

If you have time you could download the mission from the link above and have a closer look if you want.

Thanks again for your time.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Script Issue on Dedicated Server
« Reply #14 on: 05 Sep 2007, 00:31:56 »
I would not test it in a dedi server, and it is already working in SP. If you dont get the hint with the coords then the problem is in onMapSingleClick "AlphaTarget setpos _pos; setfire=false" while it seems correct to me.
Does "AlphaInsertion" marker already exist on the map?