Home   Help Search Login Register  

Author Topic: [SOLVED]Set Waypoint?/Driving?  (Read 1759 times)

0 Members and 1 Guest are viewing this topic.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
[SOLVED]Set Waypoint?/Driving?
« on: 08 Feb 2012, 21:32:13 »
I used to play an MP mission that had vehicles driving around, rotating between game logics. Would that be a setWayPoint script?
This mission also had you pick up a "package" from one store, and deliver it to another store. But there were multiple stores, and it was selected randomly.
Now how do I get it to select one game logic position randomly, and set a waypoint for the player to that game logic?
Thanks in advance!
 
-MadPup  :D
« Last Edit: 11 Mar 2012, 04:34:32 by Mad Pup »
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Set Waypoint?/Driving?
« Reply #1 on: 08 Feb 2012, 21:42:22 »
The 'setwppos' command should prove useful here:

Code: [Select]
[player, 1] setwppos getpos logic1
'setwppos' is set out like this:

Code: [Select]
[nameofunit, waypoint index (1 for 1st wp, 2 for 2nd etc)] setwppos whereyouwant
So you say you want the player's waypoint location to be random each time? Well, you'll want to do something like this:

Code: [Select]

_NUMBERS = 5
_NUMB = random _NUMBERS

?(_numb < 1): [player, 1] setwppos getpos logic1
?( (_numb > 1)  and (_numb <= 2) ): [player, 1] setwppos getpos logic2
?( (_numb > 2)  and (_numb <= 3) ): [player, 1] setwppos getpos logic3
?( (_numb > 3)  and (_numb <= 4) ): [player, 1] setwppos getpos logic4
?( (_numb > 4)  and (_numb <= 5) ): [player, 1] setwppos getpos logic5


That code will place the player's first waypoint at one of 5 locations (each location is given by a gamelogic). You can increase the number of locations by changing 5 to whatever number you want, but you'll have to make conditions for it like I have done.

Hope this helps
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Re: Set Waypoint?/Driving?
« Reply #2 on: 08 Feb 2012, 22:01:55 »
OOHHHHH this makes sense.  :clap: Gruntage, thanks once again!

Another question (unfortunately I ask a lot): I've seen it before, and can't seem to find it in any scripts, but whats the command to skip to a certain time? From like 12:00 pm to 8:30 pm.

-Mad Pup
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Set Waypoint?/Driving?
« Reply #3 on: 08 Feb 2012, 22:04:17 »
It's:

Code: [Select]
skiptime numberofhours
So if you want to skip 8 hours, you use it like this:

Code: [Select]
skiptime 8
If you want it to skip something more precise, like 12 hours 30 minutes you would do this:

Code: [Select]
skiptime 12.5
That should do it  :good:
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Re: Set Waypoint?/Driving?
« Reply #4 on: 08 Feb 2012, 22:22:26 »
Thats it!
Thank you Gruntage!  :clap: :clap:

-MadPup
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad