Home   Help Search Login Register  

Author Topic: Changing a trigger location  (Read 855 times)

0 Members and 1 Guest are viewing this topic.

Shrapper

  • Guest
Changing a trigger location
« on: 19 Jan 2003, 17:21:41 »
Hi All,

     I am making a Co-Op mission where the players have to find an injured pilot and bring him back to a M.A.S.H. unit.  I have created a script that will place the pilot in one of five spots at the beginning of the mission (for replay value), but I am running into a few snags:

1. When the pilot is placed at one of the five markers, he will try to crawl back to marker 1 (which is where he was initially dropped down in the editor).  I want the pilot to stay at the marker he is placed at.  Any ideas?

2.  There is trigger that causes the pilot to join the group (and initially the pilot sat smack dab in the middle of it).  I need to move it around to reflect the random marker (1 through 5) that the pilot is placed at.  Can triggers be affected by the [setpos] command?  Can they be moved around like markers?

Any help would be much appreciated.

Regards,

Shrapper


P.S.

If anyone cares, below is the script used to place the pilot.

Code: [Select]
;########## HIDE.SQS #############

;This script will roll a random real number (i.e. 2.3452) between 0 and 5.  The result will ;be used to select 1 of 5 initial hiding spots for the downed pilot.  This adds replay ;value.

_roll = (random 5)

;If the roll is equal to or less than 1, the pilot will be placed at the "Hide1" marker

? (_roll) <= 1: pilot setpos [7090.13, 3252.89, 0]; Hint "I am at hide1"; goto "END"

;If the roll is equal to or less than 2, the pilot will be placed at the "Hide2" marker

? (_roll) <= 2: pilot setpos [6990.48, 3256.89, 0]; Hint "I am at hide2"; goto "END"

;If the roll is equal to or less than 3, the pilot will be placed at the "Hide3" marker

? (_roll) <= 3: pilot setpos [6890.47, 3182.49, 0]; Hint "I am at hide3"; goto "END"

;If the roll is equal to or less than 4, the pilot will be placed at the "Hide4" marker

? (_roll) <= 4: pilot setpos [6906.04, 3052.92, 0]; Hint "I am at hide4"; goto "END"

;If the roll is equal to or less than 5, the pilot will be placed at the "Hide5" marker

? (_roll) <= 5: pilot setpos [7128.86, 2975.86, 0]; Hint "I am at hide5"; goto "END"

hint "Pilot has been placed."

#END

exit


RunAwayScientist

  • Guest
Re:Changing a trigger location
« Reply #1 on: 19 Jan 2003, 17:37:20 »


  About your pilot moving back to where he was dropped, how about a simple little command? I'd suggest this command/idea:

  "Pilot1Loc = getpos Pilot1
   Pilot1 domove Pilot1Loc"

     First, it detects the pilots current position, then the pilot moves to his current position. The irony....

     I hope that helped with your number 1. If you still don't under-stand it, e-mail me or leave me a message.

   -RunAwayScientist[AF]

Shrapper

  • Guest
Re:Changing a trigger location
« Reply #2 on: 19 Jan 2003, 18:27:15 »
Runaway,

    Thanks for the response.  I placed the following code right after the #END label in my script, but it does not seem to work.

_location = getpos pilot

pilot domove _location

The poor bastard still crawls all the way back to the spot he was created at inside the editor.  Any other ideas?

Below is the entire script:

Code: [Select]
;########## HIDE.SQS #############

;This script will roll a random real number (i.e. 2.3452) between 0 and 5.  The result will ;be used to select 1 of 5 initial hiding spots for the downed pilot.  This adds replay ;value.

_roll = (random 5)

;If the roll is equal to or less than 1, the pilot will be placed at the "Hide1" marker

? (_roll) <= 1: pilot setpos [7090.13, 3252.89, 0]; Hint "I am at hide1"; goto "END"

;If the roll is equal to or less than 2, the pilot will be placed at the "Hide2" marker

? (_roll) <= 2: pilot setpos [6990.48, 3256.89, 0]; Hint "I am at hide2"; goto "END"

;If the roll is equal to or less than 3, the pilot will be placed at the "Hide3" marker

? (_roll) <= 3: pilot setpos [6890.47, 3182.49, 0]; Hint "I am at hide3"; goto "END"

;If the roll is equal to or less than 4, the pilot will be placed at the "Hide4" marker

? (_roll) <= 4: pilot setpos [6906.04, 3052.92, 0]; Hint "I am at hide4"; goto "END"

;If the roll is equal to or less than 5, the pilot will be placed at the "Hide5" marker

? (_roll) <= 5: pilot setpos [7128.86, 2975.86, 0]; Hint "I am at hide5"; goto "END"

#END

_location = getpos pilot

pilot domove _location

exit
« Last Edit: 19 Jan 2003, 18:28:08 by Shrapper »

Offline Black_Feather

  • Former Staff
  • ****
  • I'll never forget you Daisey.
Re:Changing a trigger location
« Reply #3 on: 19 Jan 2003, 19:06:29 »
You didn't give the pilot any waypoints did you? You can move triggers with setpos

triggername setpos getpos pilotname




Shrapper

  • Guest
Re:Changing a trigger location
« Reply #4 on: 19 Jan 2003, 21:16:24 »
Blackfeather,

     I made sure the pilot had no weapons.  Thanks for helping me with the trigger movement commands (I could only find references for Markers).  I will give this a try and see if it solves the trigger issue (and hopefully my wandering pilot, too).

Regards,

Shrapper
« Last Edit: 19 Jan 2003, 21:16:39 by Shrapper »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Changing a trigger location
« Reply #5 on: 19 Jan 2003, 22:08:35 »
firstly..
Quote
You didn't give the pilot any waypoints did you?
waypoints

Quote
I made sure the pilot had no weapons.
weapons

So the pilot must not have any WAYPOINTS :D


to solve this for good you put

pilotname stop true
to pilots init field and

pilotname stop false
to the trigger your moving around with him.

Not all is lost.

Shrapper

  • Guest
Re:Changing a trigger location
« Reply #6 on: 20 Jan 2003, 00:17:36 »
Artak,

   Sorry, I did indeed mean WAYPOINTS (not weapons, although I did make him unarmed so he would be even more helpless ;) ). I solved the issue with a somewhat less elegant solution.  I now have a pilot/trigger combination that starts randomly at 1 of 5 spots and I am quite happy.  Thanks for all the assitance, you guys are fast and friendly (like a burger joint, kinda).

Regards,

Shrapper