OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: CopyrightPhilly on 01 May 2005, 15:42:56
-
hey chaps, like the topic title says
I want to disable any sort of respawn so i can manualy code it
(setdammage 0, setpos and so on)
works fine in the editor when shooting ai, but, when in mutiplayer is just zooms out of the soldier and thats it, it stops the code from respawing...
I do have respawn=none; set in my descrition file.
i can used the killed event handler because i'm making this one so its playable on 1.46...
any ideas?
-
You probably could try this way...
make all the units exec a respawn script
In init.sqs:
; all your soldiers reference
soldiers = [a, b, c, d]
{[_x] exec "respawn.sqs"} forEach soldiers
or you could do this from editor under init field of unit:
[this] exec "respawn.sqs"
In respawn.sqs:
_unit = _this select 0
_unitPos = getPos _unit
_unitDmg = getDammage _unit
; continue to get whatever you want
@!(alive _unit)
deleteVehicle _unit
_unit = "soldiers" createUnit _unitPos
[_unit] exec "respawn.sqs"
Hope this helps
-
thats more or less how mine is, its just when you die it starts to zoom out of your dead body, just like it normally would in single player.
[edit]
I have found a way to stop it doing this but i need to know if it would cause any lag on when playing it online.
if i change it from
respawn=none;
to
respawn=base;
respawndelay=36000;
it works fine, but as you can see 36000 is 10 hr respawn delay, now would this cause any unessery lag?
cheers, Phil
-
another way to do it is probably to have a wait for a few seconds or @(condition) in the script..
then you wouldn't have to have a 10hr respawn delay?
-
I'm confused as to what specifically you want to do.
When a player dies and respawns as a seagul, they execute a script called
onPlayerRespawnAsSeagull.sqs
This file is internal to a scripts.pbo found in the DTA folder
It used an internal eventhandler which returns the following elements
_player = _this select 0 (your dead body)
_killer = _this select 1
_seagull = _this select 2
You can create a copy of this file and edit it to your hearts content.
Then place it in your mission folder, it will then overwrite the BIS file
There are other files in their, that you can do the same too
these are:
onPlayerrespawnOtherUnit.sqs
onPlayerKilled.sqs
*********************************************************
If you state the specific criteria that you are trying to achieve, then we may be able to help further
-
what i'm wanting to do is make my own respawn script, this is so i can try and delete each unit as they respawn (this will prevent and AI from respawning if someone quits) and also it will make it easyer to replace the defult respawn weapons.
i'll pull apart the dta file and see what goodies i can steal...
-
well what you could do is deletevehicle them, if its a player, it wont delete, if its ai, it will
bear in mind where to run the code
if the unit is in a group which has a player leader, it is local to the players pc
any other instance its local to the server
and the best way to do this is by attaching a "Killed" eventhandler to the unit and run a script from it
or by simply editing one of the scripts in the scripts.pbo found in the DTA folder and placing the edited version in your mission folder
-
I tried to write my own respawn script too, wouldn't work (at least if respawn = none in description.ext - and that's what I needed, well found a different solution for my problem).
Have a look at this, mapfact created a different respawn, shouldn't be too hard to do your own then :
http://www.mapfact.gamigo.de/include.php?path=content/download_eng.php&contentid=385 (http://www.mapfact.gamigo.de/include.php?path=content/download_eng.php&contentid=385)
h