Scripting spawn points
Moderator: Core Staff
Scripting spawn points
For my mod I am trying to script extra spawn points. Because some times people spawn in to each other. I know how to script spawn points but I don't know how to add them to the rest of the tdm spawn points so they can be used by the original script.
If anyone needs more info ask it here
I hope someone can help me.
If anyone needs more info ask it here
I hope someone can help me.
Re: Scripting spawn points
Try to look through the original cod spawnpoint functions that are loaded at the gamestart:
This means, that if you would like extra spawnpoints, you would need to either modifiy all the gscs or be able to change the classname of stuff spawned from script. Only the modifying of gscs is possible have fun with your new hobby
Code: Select all
spawnpointname = "mp_tdm_spawn";
spawnpoints = getentarray(spawnpointname, "classname");
Re: Scripting spawn points
What should I modify about the scripts then?
Isn't it just possible to edit the spawn logic and add the spawn in it?
Isn't it just possible to edit the spawn logic and add the spawn in it?
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Scripting spawn points
I think what KS said should work, I think if you move the player to a certain position as soon as they spawn, they shouldn't see the original position on their screen.
-
Re: Scripting spawn points
@KillerSam
Thank you
I already know how to script those fake spawn point, but not how to script real spawn point. But it isn't possible so I will try a few things and if I still can't fix it I will ask it here.
Thank you
I already know how to script those fake spawn point, but not how to script real spawn point. But it isn't possible so I will try a few things and if I still can't fix it I will ask it here.
No they will see that.F |Madness| U wrote:I think what KS said should work, I think if you move the player to a certain position as soon as they spawn, they shouldn't see the original position on their screen.
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Scripting spawn points
If your doing a mod just add in a tiny white flash when they spawn, that way they won't see the original spawnloc.
-
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Scripting spawn points
You can spawn entities using spawn() but I believe actual mp spawn points cannot be spawned.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Scripting spawn points
Spawnpoints in mapping are just placeholder entities, the problem is that they are initiated before the game starts, so adding to them MUST be done prior to the initiated spawns, but I do not believe it is impossible to add spawns.Rezil wrote:You can spawn entities using spawn() but I believe actual mp spawn points cannot be spawned.
Gonna go test a quick theory.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Scripting spawn points
You do not NEED any spawnpoints...
You just need to override the spawnpoint callback with your own thread.
The 'custom spawn logic' is just an example to show that spawn points do not need to be predefined.
You could easily create an array of many, many spawnpoints and then create a logic to choose which spawn is required.
You just need to override the spawnpoint callback with your own thread.
Code: Select all
level.onSpawnPlayer = ::newSpawn;
Code: Select all
newSpawn()
{
    locs = customSpawnLogic();
    self spawn( locs[0], locs[1] );
}
Â
customSpawnLogic()
{
    locs = [];
    locs[0] = (randomintrange(0, 100),randomintrange(0, 100),randomintrange(0, 100));
    locs[1] = (randomintrange(0, 100),randomintrange(0, 100),randomintrange(0, 100));
    return locs;
}
You could easily create an array of many, many spawnpoints and then create a logic to choose which spawn is required.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Scripting spawn points
Yea I already had something like that. But then used as external spawn points and not for replacing all spawns. But that is indeed a smart thing to do Thanks you for your help, I am going to try it.Drofder2004 wrote:You do not NEED any spawnpoints...
You just need to override the spawnpoint callback with your own thread.
Code: Select all
level.onSpawnPlayer = ::newSpawn;
The 'custom spawn logic' is just an example to show that spawn points do not need to be predefined.Code: Select all
newSpawn() { Â Â Â Â locs = customSpawnLogic(); Â Â Â Â self spawn( locs[0], locs[1] ); } Â customSpawnLogic() { Â Â Â Â locs = []; Â Â Â Â locs[0] = (randomintrange(0, 100),randomintrange(0, 100),randomintrange(0, 100)); Â Â Â Â locs[1] = (randomintrange(0, 100),randomintrange(0, 100),randomintrange(0, 100)); Â Â Â Â return locs; }
You could easily create an array of many, many spawnpoints and then create a logic to choose which spawn is required.
Who is online
Users browsing this forum: No registered users and 14 guests