OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Smooth Operator on 03 Mar 2007, 11:31:54
-
greets!
ive been on this website all day looking at tutorials and posts and now i'm finally stuck. just a little background on me, today was the first day for me to ever open the mission editor making me a complete nubcake. im stuck on this respawn script that i found in the respawn tutorial. what im trying to do is make a deathmatch map with 5 playable civilians, each having a unique specific respawn location. the only thing i can decipher from the tutorial is how to randomize respawn locations out of a specified number. ive created 5 playable civilians named p1-p5 and 3x3 ellipse markers named p1_respawn-p5_respawn, but i dont know how to assign p1 to spawn at p1_respawn. any advice?
thanks in advance
also: what would be the best way to eliminate "xxx killed xxx, friendly fire"
-
Don't know how to solve that respawn issue, I'm not good at MP scripting so I'll leave that open for someone else. The radio stuff might be fixed by using: enableRadio (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=d#enableRadio) false;
Tested and works for me if I put down a few civilians, one of them is the player (me) and one BLUFOR soldier with the health slider set to the left. In a trigger with Condition: true; I put the command (enableRadio false) and they don't shout when I hit or kill them.
-
sweet, fix the radio thing. a little update on where im stuck. in the tutorial it says:
Create a marker for it, calling it ****_respawn
in the following example this is called "rescue_respawn"
which i'm assuming means create p1_respawn, p2_respawn...etc etc. which ive done
And then a trigger for each player that is required to respawn at this other location.
this is where im stuck..what the hell do i do with this?
In this example, player is called "RP5"
class Item19
{
position[]={8673.614258,6.824206,12584.245117};
a=0.000000;
b=0.000000;
repeating=1;
age="UNKNOWN";
text="RP5 respawn trigger";
name="RP5_Respawn_";
expCond="alive RP5";
expActiv="[RP5, ""rescue_respawn""] exec ""rescue_respawn.sqs""";
class Effects{};
};
ive created a rescue_respawn.sqs in the users\x\missions\mymission directory with the following code:
; rescue_respawn.sqs
; Script that respawns players in a specific zone.
; Simplified from Backoff's multiple respawn script.
;
; Syntax: [player name, respawn marker name] exec "respawn_rescue.sqs"
;
; "Player name" is the name given to the player.
; "respawn marker name" is the name of the respawn marker the player
; should respawn in.
;
; Example: [Rescue1, "rescuers_area"] exec "respawn_rescue.sqs"
;
_player = _this select 0
_zone = _this select 1
_radius = 10
_pos = getMarkerPos _zone
; Create random number to set the player position
_randx = random (_radius)
? ( random(10) < 5 ): _randx = _randx * -1
_randy = random(_radius)
? ( random(10) < 5 ): _randy = _randy * -1
; Set the position
_player setpos [(_pos select 0) + _randx, (_pos select 1) + _randy, 0]
Exit
so now i just need to know what to do with the triggers (i think?) or do i need to create a description.ext file in addition to this? god i feel like such a nub. thanks again in advance.
-
Press F3 and double click somewhere on the map to create a trigger. Check the attached image for the values of your trigger.
Once p1 gets killed the respawn script will be activated. Make sure though that the script is in the mission folder.
Yes in order to let your men respawn you have to create a description.ext file with the respawn=x command. Check this (http://community.bistudio.com/wiki/Description.ext#Respawn_Options) page on the Biki.
-
thanks for the fast responses.
i did exactly as you said and created the triggers. when i loaded the map on multiplayer i got some error about a zero divisor. so i changed the activation to "[pn, pn_respawn] exec "rescue_respawn.sqs"; per the instructions when referring to the "syntax", and added a description.ext to the mission folder.... i used the respawn=2 and i respawn in the place i died....so still no luck with the script... is the condition "!(alive pn)" ? hard to see if that is a ! or not in the picture.
-
Yes, it says "!(alive pn). It is a way to write boolean functions and it means "NOT (alive pn)".