UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Randomized Spawn?

broken avatar :(
Created 12 years ago
by chromastone10
0 Members and 1 Guest are viewing this topic.
2,604 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 8 January 2014
Last active: 8 years ago
Posts
840
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Embers are the new lens flares
×
chromastone10's Groups
Mapper Has released one or more maps to the UGX-Mods community.
chromastone10's Contact & Social Linkschromastone1chromastone10chromastone10
Is there a way to either

A. Have the player randomly spawn on at the start of a game but make sure to not have another player spawn at the same place with him

OR

B. Add like 5-6 spawns total that each player could randomly spawn at each game
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Replace the contents of

(in_zombiemode.gsc)

Code Snippet
Plaintext
coop_player_spawn_placement()
{
structs = getstructarray( "initial_spawn_points", "targetname" );

flag_wait( "all_players_connected" );

//chrisp - adding support for overriding the default spawning method

players = get_players();

for( i = 0; i < players.size; i++ )
{
players[i] setorigin( structs[i].origin );
players[i] setplayerangles( structs[i].angles );
players[i].spectator_respawn = structs[i];
}
}

with

Code Snippet
Plaintext
	flag_wait( "all_players_connected" );

players = get_players();

//spawn points are split, so grab them both seperately
north_structs = getstructarray("north_spawn","script_noteworthy");
south_structs = getstructarray("south_spawn","script_noteworthy");

side1 = north_structs;
side2 = south_structs;
if(randomint(100)>50)
{
side1 = south_structs;
side2 = north_structs;
}

//spawn players on a specific side, but randomize it up a bit
for( i = 0; i < players.size; i++ )
{

//track zombies for sounds
players[i] thread player_zombie_awareness();
players[i] thread player_killstreak_timer();


if(i<2)
{
players[i] setorigin( side1[i].origin );
players[i] setplayerangles( side1[i].angles );
players[i].respawn_point = side1[i];
players[i].spawn_side = side1[i].script_noteworthy;
}
else
{
players[i] setorigin( side2[i].origin);
players[i] setplayerangles( side2[i].angles);
players[i].respawn_point = side2[i];
players[i].spawn_side = side2[i].script_noteworthy;
}
}

This will give the same randomization affect as in verruckt. Change the struct KVP's as needed.
Last Edit: June 11, 2014, 04:30:44 pm by daedra descent
Marked as best answer by chromastone10 12 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 8 January 2014
Last active: 8 years ago
Posts
840
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Embers are the new lens flares
×
chromastone10's Groups
Mapper Has released one or more maps to the UGX-Mods community.
chromastone10's Contact & Social Linkschromastone1chromastone10chromastone10
Ok I got it working, if you would like split spawning in your map like vurrukt replace

Code Snippet
Plaintext
coop_player_spawn_placement()
{
structs = getstructarray( "initial_spawn_points", "targetname" );

flag_wait( "all_players_connected" );

//chrisp - adding support for overriding the default spawning method

players = get_players();

for( i = 0; i < players.size; i++ )
{
players[i] setorigin( structs[i].origin );
players[i] setplayerangles( structs[i].angles );
players[i].spectator_respawn = structs[i];
}
}


with this function instead

Code Snippet
Plaintext
coop_player_spawn_placement()
{
flag_wait( "all_players_connected" );

players = get_players();

//spawn points are split, so grab them both seperately
north_structs = getstructarray("north_spawn","script_noteworthy");
south_structs = getstructarray("south_spawn","script_noteworthy");

side1 = north_structs;
side2 = south_structs;
if(randomint(100)>50)
{
side1 = south_structs;
side2 = north_structs;
}

//spawn players on a specific side, but randomize it up a bit
for( i = 0; i < players.size; i++ )
{

//track zombies for sounds
//players[i] thread player_zombie_awareness();
//players[i] thread player_killstreak_timer();


if(i<2)
{
players[i] setorigin( side1[i].origin );
players[i] setplayerangles( side1[i].angles );
players[i].respawn_point = side1[i];
players[i].spawn_side = side1[i].script_noteworthy;
}
else
{
players[i] setorigin( side2[i].origin);
players[i] setplayerangles( side2[i].angles);
players[i].respawn_point = side2[i];
players[i].spawn_side = side2[i].script_noteworthy;
}
}
}




NEXT:

In your mapname.gsc go to "zones you want activated at map start" and add the 2 zones that the players can start in

then the spawn structs in radiant add to 2 of them "script_noteworthy - north_spawn" then add on the last 2 spawn structs "script_noteworthy - south_spawn"
Last Edit: June 11, 2014, 06:47:38 pm by chromastone10
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
...

You never said anything about zones. My answer is the best answer.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 8 January 2014
Last active: 8 years ago
Posts
840
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Embers are the new lens flares
×
chromastone10's Groups
Mapper Has released one or more maps to the UGX-Mods community.
chromastone10's Contact & Social Linkschromastone1chromastone10chromastone10
I already have my zones activate from the start, your answer gave me a bad syntax till I edited the vurrukt spawning
Last Edit: June 11, 2014, 09:25:49 pm by chromastone10
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I already have my zones activate from the start, your answer gave me a bad syntax till I edited the vurrukt spawning

Because you didn't do it right. I said to paste the contents(i.e. the code INSIDE the function) into your Coop_player_spawn_placement();
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 8 January 2014
Last active: 8 years ago
Posts
840
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Embers are the new lens flares
×
chromastone10's Groups
Mapper Has released one or more maps to the UGX-Mods community.
chromastone10's Contact & Social Linkschromastone1chromastone10chromastone10
Because you didn't do it right. I said to paste the contents(i.e. the code INSIDE the function) into your Coop_player_spawn_placement();

I did, but this

Code Snippet
Plaintext
players[i] thread player_zombie_awareness();
players[i] thread player_killstreak_timer();

gave an error too, so I removed that myself, and I made my answer best answer because I did a made it a mini tutorial in case anyone else who wanted to have split spawning came here
Last Edit: June 11, 2014, 09:38:59 pm by chromastone10

 
Loading ...