Jump to content


Photo

Is there a way to 'pause' scripts

scripts spawning vehicles

  • Please log in to reply
9 replies to this topic

#1 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 posts

Posted 10 September 2013 - 10:10 PM

HI

 

Just a quick question, as I am currently trying to spawn 2 vehicles that appear from off the map at the same time. At the moment they both spawn but are stuck in each other, I am wondering if there is a way to pause the script that spawns them long enough for one vehicle to move then the other vehicle spawns. It is being used in a private mod.

 

 

I have attached the current script as it is

 

 

Thanks in advance

 

Lowe54

 

Attached File  LACallCrashRescue.txt   0bytes   48 downloads



#2 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 11 September 2013 - 05:48 AM

No way to "pause" a script, but you can delay PushActions.

n.PushActionWait(ACTION_APPEND, 2.5f);

Increase the "f" value on a line like that, and the script takes longer to move on to the next action.

 

I use a value of 30 for all my call scripts to represent the delay of the vehicle coming from off map,



#3 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 posts

Posted 11 September 2013 - 12:18 PM

I have tried what you suggested, it works for the delays but in regards to the vehicles being stuck I have managed to solve that by creating a second spawn point

 

Thanks very much

 

Lowe54

 

Edit: Im now getting a 'automatic variable p1 is allocated' warning when the vehicle spawns, is this normal?



#4 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 11 September 2013 - 08:08 PM

Edit: Im now getting a 'automatic variable p1 is allocated' warning when the vehicle spawns, is this normal?


Can't look at the script at the moment, but that sounds like you've assigned "p1" to multiple people somewhere. Just like the vehicles, they need to be uniquely identified.

#5 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 posts

Posted 11 September 2013 - 10:56 PM

Just double checked the script,, there is nowwhere where 'p1' has been double allocated, a updated version of the script is attached

 

Attached File  LACallCrashRescue.txt   0bytes   42 downloads



#6 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 11 September 2013 - 11:14 PM

I see something; both of your vehicles are defined as "n" now. I don't know what would be causing that other error, since you've got everything unique when it comes to p1.



#7 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 posts

Posted 12 September 2013 - 10:16 AM

Managed to solve it by changing the second vehicle from 'n' to 'n2' and by putting 'Person' in front of the 'p1'

 

Thanks for all the help

 

 

 

 

Lowe54

Attached Files



#8 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 posts

Posted 13 September 2013 - 09:52 PM

Hi all

I really should make this a 'Help with my scripting issues' thread, as i dont see the point in starting a new one that covers a scripting problem as now i have a new problem, I'm trying to make it so that i can buy personnell from a mobile center, like the FBI command truck in the LA mod, the only trouble is that it gives me a "(VCmd_Mobile_Command_Centre624e9): Warning: Automatic variable const char OBJ_FF[] is allocated", ive checked the script and can find nothing wrong, can anyone help, the script is attached

 

Attached File  VCmd_Mobile_Command_Centre.txt   0bytes   35 downloads

 

Lowe54



#9 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 posts
  • Gender:Male

Posted 14 September 2013 - 04:55 AM

Hmm, not noticing a problem there either.



#10 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 posts

Posted 15 September 2013 - 08:05 PM

I dont know whats happening, but i tried another script that dispatches off map vehicles, and its throwing the same error, should I reinstall the game, as i dont know what to do now, the script that i tried is attached

 

Lowe54

 

Attached File  MedicalPCmds.txt   0bytes   37 downloads







Also tagged with one or more of these keywords: scripts, spawning vehicles