OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Viking on 25 Aug 2002, 00:03:03

Title: Single Mission Respawn
Post by: Viking on 25 Aug 2002, 00:03:03
Is it possible to respawn units in Single Missions? If so, can someone tell me how?
Title: Re:Single Mission Respawn
Post by: danbryant4 on 25 Aug 2002, 04:57:34
I believe that it is not possible. I know if would have to be done via a script, but I think there was some problem with it still ending, b/c even if it checks every 0.0000000000000001 seconds, he is still dead long enough for it to end.

Daniel J Bryant
Title: Re:Single Mission Respawn
Post by: Black_Feather on 25 Aug 2002, 05:33:38
hmm its pretty much impossible
Title: Re:Single Mission Respawn
Post by: tai mai shu on 25 Aug 2002, 10:13:44
erm, the deathscenescriptthingy.sqs is what makes it impossible to keep playing or respawn, but what if you made your own deathscene.sqs and put it ingame, and had it activate when a trigger detects if your player is dead.

if you rename the script to match the name fo the official deathscene script, it will override it, and thus you wont die???
Title: Re:Single Mission Respawn
Post by: Viking on 25 Aug 2002, 13:30:50
I was just looking for a script to respawn enemy soldiers if they are killed. (handy in a mission with alot of units)
Title: Re:Single Mission Respawn
Post by: CrashnBurn on 25 Aug 2002, 14:07:34
What you want are the createsquad scripts over at -

http://www.backoff.ch/ofp/

Title: Re:Single Mission Respawn
Post by: Viking on 25 Aug 2002, 15:45:49
Thanks! How about someone made a sample mission? One that people get respawned if killed? Possible?
Title: Re:Single Mission Respawn
Post by: Gastovski on 25 Aug 2002, 23:16:59
Just make a script called "onplayerkilled.sqs" and put in it:

Code: [Select]
_player = ap
_respawn = gamelogic
~1
titletext ["You were killed","PLAIN",1]
_player setpos _respawn
_player setdammage 0
exit

I think that it should work...
Title: Re:Single Mission Respawn
Post by: Viking on 26 Aug 2002, 16:12:24
Gastovski!

Could you explain that abit better, please. And in case you misunderstood, I am looking for a script that makes the enemy respawn when killed, so that there are always enemy soldiers coming at u. (Good for BHD missions)! :)
Title: Re:Single Mission Respawn
Post by: CrashnBurn on 26 Aug 2002, 23:44:48
Download the createsquad scripts like I mentioned in my earlier post. Spend some time learning how to use them. There's a sample mission included with the scripts.

For checking how many units are left in a group and spawning more to join the fight you could use a small script like this:

;---------------------------------------------
#loop
? NOT(alive player) : exit
?(("Alive _x" count units groupname) <= 3): [] exec "spawn.sqs"; exit
~5
goto "loop"
;--------------------------------------------

Title: Re:Single Mission Respawn
Post by: Gastovski on 27 Aug 2002, 00:20:56
Hehe I thought you wanted a respawn for the player...

I will explain though...

"_player = ap" - Assigns the variable _player as ap (players name
"_respawn = gamelogic" - Assigns the var _respawn as gamelogic (The position that you want the player/unit to respawn)
"~1" - Wait approximately 1 second
"titletext ["You were killed","PLAIN",1]" - Print 'You were killed' on the screen
"_player setpos _respawn" - Move _player to _respawn
"_player setdammage 0" - Make it so _player is not damaged in any way
"exit" - Exit the script

And the code said above should work too...  ;D
Title: Re:Single Mission Respawn
Post by: Viking on 27 Aug 2002, 09:16:04
Thanks
Title: Re:Single Mission Respawn
Post by: Viking on 27 Aug 2002, 09:18:17
How do you suggest using it? Instead of having to make a script for every D*** enemy unit in the mission. Please!
Title: Re:Single Mission Respawn
Post by: CrashnBurn on 27 Aug 2002, 13:02:01
The script I wrote will check 1 enemy group. If you have 4 groups, of lets say 9 soldiers, you need to copy the script 4 times and put the proper groupnames in each one. Using the createsquad scripts, you can spawn a new group into the battle as each of the first groups take high casualties.
Title: Re:Single Mission Respawn
Post by: Viking on 27 Aug 2002, 14:37:09
Does this work repeatedly? Like if one group takes high casualties, then aother group gets spawned, and if they get high casualties, ANOTHER group gets spawned, etc.
Does it work like that? Do you have infinite enemies?
Title: Re:Single Mission Respawn
Post by: Viking on 27 Aug 2002, 14:42:34
CrashnBurn! Could oyu post that script again, but only with a groupname in it(say Foxtrot)? And also please answer the question above.
Title: Re:Single Mission Respawn
Post by: CrashnBurn on 27 Aug 2002, 15:24:57
I'll make you a sample mission, but it's gonna take me a little while. Check back later this afternoon. It's 5:30 AM my time now.
Title: Re:Single Mission Respawn
Post by: CrashnBurn on 28 Aug 2002, 16:15:36


[attachment deleted by admin]