OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Evan Scown on 27 Sep 2006, 02:52:28

Title: Respawns
Post by: Evan Scown on 27 Sep 2006, 02:52:28
Hello,

I'm making a training map for the clan I'm in and I've set up a rather noice little loadout script...for example, the AIs at the base who are really just novalty troops start out with a certain loadout and hat colour *using the UKF mod*. What I'm wanting to do is that when a person dies I can get them to respawn at the base with different loadouts, so say if they started out with loadout and hat colour "X" then when they respawn they would start with loadout and hat colour "X".
Title: Re: Respawns
Post by: Evan Scown on 27 Sep 2006, 02:54:08
I figure it has something to do with event handler... and that *look bellow* stuff...but It took me ages just to work out how to do that # stuff in the scripts, lol.

_type = blah goto "X"

#X
blah
blah
blah
Title: Re: Respawns
Post by: Seven on 27 Sep 2006, 05:11:40
First make a marker on the map called respawn_west; make it type elipse & whatever size you want it to be; respawning will hapen within that marker.

ad a file called description.ext to ur mission folder and in it put the text:
Code: [Select]
respawn=3
respawndelay=30

in the init field of ur soldier put
Code: [Select]
this addeventhandler ["killed",{ _this exec "unitkilled.sqs"}]

the unitkilled.sqs
Code: [Select]
_soldier = _this select 0
@alive _soldier
_soldier setObjectTexture [16,"\ukf_textuk\berets\paraberet.pac"];
_soldier setObjectTexture [17,"\ukf_textuk\berets\paraberet1.pac"];
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addweapon "correspondendingweapon"
_soldier selectweapon "correspondendingweapon"

dunno if this is all correct it's pretty late here now, but if not let it know I'm sure someone else will help out!
Greetz :zzz:
Title: Re: Respawns
Post by: Evan Scown on 28 Sep 2006, 22:41:55
Edit: Hmm...there's something that must be the issue...cause the custom loadout doesn't want to work
Title: Re: Respawns
Post by: Seven on 29 Sep 2006, 02:18:04
I hope the loadout works the first time you respawn;
if so the prob would be the eventhandler that wasn't added each respawn?
Code: [Select]
_soldier = _this select 0
@alive _soldier
_soldier addeventhandler ["killed",{ _this exec "unitkilled.sqs"}]
_soldier setObjectTexture [16,"\ukf_textuk\berets\paraberet.pac"];
_soldier setObjectTexture [17,"\ukf_textuk\berets\paraberet1.pac"];
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addmagazine "whatevermagzuneed"
_soldier addweapon "correspondendingweapon"
_soldier selectweapon "correspondendingweapon"
as for the objecttexture I just took some random thing I found for those units