Welcome, Guest Friday 18th April 2014, 04:08:42
   Home   Help Search Login Register  


Author Topic: Getting Fog.fsm in init.sqs to persist  (Read 332 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline

« on: 09 Jun 2012, 02:35:20 »

Firstly Im a noob at this so I thought asking the pros would be a second great step.

I'm using the Fog.fsm (low ground fog script) to run in my mission.
Problem is I'm not sure how to make it persistent, it runs fine on first spawn but after first death (second respawn) it stops working...

this is the line that runs in the init.sqs...

[player,100,7,14,3,8,-0.3,0.05,0.6,1,1,1,13,12,15,true,0.4,0.5,0.05,0,0,0,0,24] execFSM "Fog.fsm"

Is there a way to make it continue or initialize after every spawn or just be persistent ??

Thanks in advance Smiley
Offline Offline

« Reply #1 on: 11 Jun 2012, 01:45:33 »

Hard to say without knowing how the respawn script works. Some have options to add scripts to the players init and in others the script will have to be restarted after the player respawns by adding the code to the script.
Offline Offline

« Reply #2 on: 01 Jul 2012, 13:20:06 »

You can try something like this (untested code follows) if there's no teamswitching or fancy custom respawn scripts in the mission.
In your init.sqs:
nul = execVM "FSMRunner.sqf";

if (!alive player) then {
   sleep playerRespawnTime;
   waitUntil {sleep 0.2; alive player};
player addEventHandler ["killed", {nul = execVM "FSMRunner.sqf"}];
[player,100,7,14,3,8,-0.3,0.05,0.6,1,1,1,13,12,15,true,0.4,0.5,0.05,0,0,0,0,24] execFSM "Fog.fsm";
Pages: [1]   Go Up
  Send this topicPrint  
Jump to: