OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Shove It on 19 Dec 2004, 11:23:46

Title: 30 minutes of machine gunning non stop
Post by: Shove It on 19 Dec 2004, 11:23:46
Ok, I'm an amateur at scripting, I don't like making references to long pages of script and I need a simple script to make units respawn after they die. I need this for my mission: a very long mowing down of american retards against some russian smartasses. The mission already kicks ass but it's to short.
 
Also but it's not essential, is there a way to make the corpses stay even when they respawn, and also, is there a way to make it that the units can only respawn a few times instead of respawning an unlimited amount of times
Title: Re:30 minutes of machine gunning non stop
Post by: penguinman on 19 Dec 2004, 22:34:38
i dont know bout respawn stuff but

well to make him constantly fire you will need to just put a west invisible target addon infront of the mg and he will do exactly what u want. but have the ""retards""  run infront of the MG tracer path because he wont target them.

heres the invisible targets

http://www.aef-kampagne.de/german/Addons/InvTargets/InvTargetsAddon.zip (http://www.aef-kampagne.de/german/Addons/InvTargets/InvTargetsAddon.zip)
Title: Re:30 minutes of machine gunning non stop
Post by: Triggerhappy on 19 Dec 2004, 22:56:35
how exacly do you want them to respawn? be as specific and detailed as possible.
Title: Re:30 minutes of machine gunning non stop
Post by: Shove It on 20 Dec 2004, 08:15:15
The machine gunning isn't my biggest concern, forget about the "non-stop" part in the topic title.

About the respawning, I want it to be that when the unit dies the corpse stays (if possible) but the unit reappears at where it began in the mission and follows the same waypoints it followed and tried to follow in it's previous life. Also it would help if the respawning happens at a certain time after death.
Title: Re:30 minutes of machine gunning non stop
Post by: OFPfreak on 20 Dec 2004, 08:35:32
You could add this but its a bit simple  :P.. If you want to make it respawn at the same location just use this script. If not just ignore this script. I think this is a very basic script but it should do..

1. firstly name your unit any thing you want e.g. "MGunit1". We'll use this as example.

2. Put a new text file in the folder your mission is in.

3. Copy this in it:

Code: [Select]
_MGunit1 = _this select 0

~30
_MGunit1 setdammage 0

exit

4. Name the script anything you want but with the extension .sqs e.g. "respawn.sqs". We will take this as example (again)

now in the game create a trigger atleast covering the unit named MGunit1
that has:

Condition: not (alive MGunit1)

On Activation: [MGunit1] exec "respawn.sqs"

5. Finished!

If you want to name your unit something else just change everything ive put MGunit1 to you name but leave the _ alone, even though I dont know what it does.. peepz say it makes it a public script  ??? But dont worry too much... I hope it works :P!

(isnt that basic :D!? dont take that as my current scripting skill, its so basic! Base-ic.... Baaaaah... Baaaa-sick.....)
Title: Re:30 minutes of machine gunning non stop
Post by: Shove It on 20 Dec 2004, 17:05:31
Right, here's the problem, I can't do that because I'm making a reference and that means I have to have the folder where I put the text file in which I copy that script. However, I don't have that folder and don't tell me where to look because I have literally tried everything that's possible the last two years. Is there any way to insert the script without refering to "respawn.sqs"?
Title: Re:30 minutes of machine gunning non stop
Post by: macguba on 20 Dec 2004, 17:30:13
Yes, use gamelogics and waypoints.     Tute in the Editors Depot.
Title: Re:30 minutes of machine gunning non stop
Post by: Triggerhappy on 20 Dec 2004, 22:15:30
wait, you can't find your missions folder??

anyway, heres how you can do it all in the mission
designate a spawnpoint (gamelogic or marker)
then make a trigger covering the entire map(or at least where everyone will be) and group it to all the people who will spawn at that point. set it to:
'any member' or 'any unit' whatever it is, and 'not present', and 'repeated'
then in the trigger put {_x setdammage 0;_x setpos spawnpoint} foreach thislist
the only problem is they won't have renewed ammo.... so you will need to find a way around that, but this would be way easier if you could use scripts
Title: Re:30 minutes of machine gunning non stop
Post by: OFPfreak on 21 Dec 2004, 21:36:31
Yea, like triggerhappy sayed, and you can create like a small camp with tents full of ammo boxes.. thats 1 way of getting ammunition.. Yea peepz come from all around you and you defend without dying and when they come near the flag or something you loose... er.. I dont get the exact thing of how your missions is going to be but im really interested in downloading it :P
Title: Re:30 minutes of machine gunning non stop
Post by: OFPfreak on 21 Dec 2004, 21:38:48
wait a second, you cant find your folder right? This is the defualt path (my defualt path)

C:/Program Files/Codemasters/Operation Flashpoint/Users/Missions

And after you save a mission the mission will come in a folder in the missions directory named whatever you named the mission! You should be able to find the folder anyway... I hope it helped  :-\
Title: Re:30 minutes of machine gunning non stop
Post by: Shove It on 22 Dec 2004, 10:18:00
I tried the game logic idea, it didn't work though. That stuff that I put in the On Activation field:

{_x setdammage 0;_x setpos spawnpoint}

caused one of those messages to come up. In this case it was, "Type String, expected Nothing".
Wat do I do?
Title: Re:30 minutes of machine gunning non stop
Post by: TonyRanger on 22 Dec 2004, 11:22:50
Guys,I think we still have another way.
why we must set a unit playable to make him can respwan?
we can also do it like createunit,it's hard to explain it in short time,but you can download this mission(an COOP mission with inv1944 demo,it's write by me for inv1944 team,it only need inv1944 demo ,I don't have enough time,so I haven't make it back to only need BIS addons)
in this mission you'll find no playable but respwans germany units, thier body disappear in 10 second ,but you can don't let them disappear by edting the scripts.
Title: Re:30 minutes of machine gunning non stop
Post by: Triggerhappy on 22 Dec 2004, 14:03:20
I tried the game logic idea, it didn't work though. That stuff that I put in the On Activation field:

{_x setdammage 0;_x setpos spawnpoint}

caused one of those messages to come up. In this case it was, "Type String, expected Nothing".
Wat do I do?

{_x setdammage 0;_x setpos spawnpoint}  foreach thislist


also, if you are using (1.85?) you can use the typeof command and spawn the units, so long as they are ai

{(name _x) = (typeof _x) createunit [getpos spawnpoint,grpnull]} foreach thislist