OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started 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".
-
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
-
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:
respawn=3
respawndelay=30
in the init field of ur soldier put
this addeventhandler ["killed",{ _this exec "unitkilled.sqs"}]
the unitkilled.sqs
_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:
-
Edit: Hmm...there's something that must be the issue...cause the custom loadout doesn't want to work
-
I hope the loadout works the first time you respawn;
if so the prob would be the eventhandler that wasn't added each respawn?
_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