Jump to content
Sign in to follow this  
KingGsterUK

How to set player and NPC respawns

Recommended Posts

Hey guys, Im looking for someone who knows a bit about scripting, I think, not sure lets have a look!

What I'm trying to achieve:

I want to create a mission where I can call In support via radio triggers. Support could be from paradrops to armoured/infantry division advancements.

That part is all easy enough. The tricky part comes when I want this to repeat:

1) The armour/infantry gets destroyed/killed. I would like them to respawn and follow the same waypoints and sync'ed triggers they had originally.

2) The chopper/plane paradrops infantry in, the chopper/plane flies away and goes to next waypoint. I would like chopper/plane to fly away, disappear, respawn and follow the same waypoints and sync'ed triggers they had originally.

3) The player dies, mission over. I would like the player to respawn to keep the mission flowing.

Any help on this topic would be extremely appreciated, thank you :)

Share this post


Link to post
Share on other sites

Scripting leads the way with this one.

Your radio triggers need to activate a script which handles the spawning of your reinforcement group, its waypoints and finally a trigger which fires when the group has died.

Relevant functions that you will need are:

bis_fnc_spawngroup

bis_fnc_spanwvehicle

createwaypoint

createtrigger

Also, if you are scripting a MP mission, ensure that the group is only created by the server using an if statment in the script:

if (!isServer) then {exitwith []}; // this would need adjusting for a non-dedicated server

The job of the script would be:

1. Create a group with a name

2. Fill that group with dudes

3. Createwaypoints for the group (these could be set dynamically to, for example player's current position)

4. Create a trigger which is activated by some sort of !alive check

When the entire reinforcement group has died, the trigger will fire and could be set to do some or all of the following:

1. Delete the bodies/burning hulls of the reinforcement group

2. Add the reinforcement option back to the player

Your flying plane you've mentioned in point 2 could be achieved by making it permanently present and putting

this allowdamage false; this setcaptive true;

it's init filed, this will prevent it getting shot at or taking damage at all. Then just simply have it fly through a trigger which will spawn a group and put that group in the plane's cargo. Relevant commands would be

moveincargo

As for your third point, I'm not sure if spawning in single player can be done without a teamswitch style respawn.

If you make it a multiplayer mission though, all you need to do is have a marker named

respawn_west

(assuming you're dealing with marines here) and select the relevant respawn type to include in the description.ext file in the mission folder.

I know all this sounds like a lot of things to remember or do, but there are already loads of excellent script snippets or full missions which already do most of what you want. Simply depbo a few of them and see how they work - a little patience and perseverance goes a long way! Good luck with you scripting!

Share this post


Link to post
Share on other sites

Thanks Turok, I'll take some time to digest what you wrote and have a look at some examples. I'll update when done.

Share this post


Link to post
Share on other sites

Are there any good scripting tutorials out there for absolute beginners and if there are, which ones would you recommend?

Share this post


Link to post
Share on other sites

See this why they need to put a button for repspawn in group for the non-geeks to be able make missions which would make the whole multyplayer much more fun then just playing the monoply maps that 3- 04 programmers made.

Share this post


Link to post
Share on other sites

OK kt187, or you could start to learn how to do things... like ALOT of people are doing including me. Btw, calling people geeks could be construed as insulting in some quarters...

Share this post


Link to post
Share on other sites

No offence taken. I don't mind trying things out and learning. But I would like to know where absolute beginners could find tutorials on scripting, maybe how you learned it?

Share this post


Link to post
Share on other sites

First place to look is Mr Murrys Editing guide. Thats a REAL good place to start,

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×