Zum Inhalt wechseln


Foto

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 Beiträge:

Geschrieben 10 September 2013 - 10:10

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

 

Angehängte Datei  LACallCrashRescue.txt   0bytes   48 Anzahl der Downloads



#2 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 Beiträge:
  • Gender:Male

Geschrieben 11 September 2013 - 05:48

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 Beiträge:

Geschrieben 11 September 2013 - 12:18

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 Beiträge:
  • Gender:Male

Geschrieben 11 September 2013 - 08:08

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 Beiträge:

Geschrieben 11 September 2013 - 10:56

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

 

Angehängte Datei  LACallCrashRescue.txt   0bytes   42 Anzahl der Downloads



#6 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 Beiträge:
  • Gender:Male

Geschrieben 11 September 2013 - 11:14

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 Beiträge:

Geschrieben 12 September 2013 - 10:16

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

Angehängte Datei(en)



#8 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 Beiträge:

Geschrieben 13 September 2013 - 09:52

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

 

Angehängte Datei  VCmd_Mobile_Command_Centre.txt   0bytes   35 Anzahl der Downloads

 

Lowe54



#9 The Loot

The Loot

    Battalion Chief

  • Members
  • 725 Beiträge:
  • Gender:Male

Geschrieben 14 September 2013 - 04:55

Hmm, not noticing a problem there either.



#10 Lowe54

Lowe54

    Firefighter

  • Members
  • 21 Beiträge:

Geschrieben 15 September 2013 - 08:05

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

 

Angehängte Datei  MedicalPCmds.txt   0bytes   37 Anzahl der Downloads







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