UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: aster-99 on October 30, 2014, 05:20:40 pm

Title: player spawn point
Post by: aster-99 on October 30, 2014, 05:20:40 pm
hi guys, i want to know if it's possible to set all players spawns without put a script struct in the map, like using radiant cordinates. really thanks
Title: Re: player spawn point
Post by: DeletedUser on October 30, 2014, 06:10:15 pm
hi guys, i want to know if it's possible to set all players spawns without put a script struct in the map, like using radiant cordinates. really thanks
no
Title: Re: player spawn point
Post by: JBird632 on October 30, 2014, 06:15:18 pm
no
Uhh I'm pretty sure you could just spawn the script struct where ever you want
Title: Re: player spawn point
Post by: BluntStuffy on October 30, 2014, 06:16:18 pm
well, guess it is possible. Just not something that's supported by default, so you need to do some scripting to make it work. I wonder why you'd want to do that though, placing a few struct's isn't that big of a deal, is it?
Title: Re: player spawn point
Post by: aster-99 on October 30, 2014, 06:27:01 pm
i can't have access to radiant and i wont (pc problem)... i need only to add spawns to finish my map and i was thinking if it was possible via scripts
Title: Re: player spawn point
Post by: HitmanVere on October 30, 2014, 06:38:14 pm
i can't have access to radiant and i wont (pc problem)... i need only to add spawns to finish my map and i was thinking if it was possible via scripts

Why not send .map file to someone else and they can add them?
Title: Re: player spawn point
Post by: MakeCents on October 30, 2014, 06:45:26 pm
hi guys, i want to know if it's possible to set all players spawns without put a script struct in the map, like using radiant cordinates. really thanks

I don't know what will happen without those structs but you can set each players origins like in the link below. But you will have to do it for initial spawns and for when they die/respawn. I do this in ILS so when they have teleported it makes sure it doesn't respawn them back in the original area. But I also have those structs so....

http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Player::SetOrigin (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Player::SetOrigin)

You would simply thread a function to get all the players when the map starts, after waiting for players to connect, and set their origins to test it

Try something like:

Code Snippet
Plaintext
//thread Spawn_Player_Here: //thread this up in init in your mapname.gsc

Spawn_Player_Here(){
flag_wait("all_players_connected");
x = 0;
players = get_players();
for(i=0;i<players.size;i++){
players[i] SetOrigin((x,0,0));
x=x+30;
}
}

Adjust coordinates accordingly.
Title: Re: player spawn point
Post by: BluntStuffy on October 30, 2014, 07:05:25 pm
^ in addition to that. The Original function for this is in _zombiemode.gsc: maybe just as easy to change  that one

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];
}
}
Title: Re: player spawn point
Post by: aster-99 on October 30, 2014, 08:17:04 pm
^ in addition to that. The Original function for this is in _zombiemode.gsc: maybe just as easy to change  that one

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];
}
}
so in players.spectator_respawn = structs; what should i put?
Code Snippet
Plaintext
coop_player_spawn_placement()
{
flag_wait( "all_players_connected" );

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

players = get_players();

for( i = 0; i < players.size; i++ )
{
switch(i)
{
case 0:
players[i] setorigin( -222.5,-210,11160 );
players[i] setplayerangles( 0,45,0 );
players[i].spectator_respawn = structs[i];
break;
case 1:
players[i] setorigin( -244,188,11160 );
players[i] setplayerangles( 0,315,0 );
players[i].spectator_respawn = structs[i];
break;
case 2:
players[i] setorigin( 140.3,203,11160 );
players[i] setplayerangles( 0,225,0 );
players[i].spectator_respawn = structs[i];
break;
case 3:
players[i] setorigin( 148.8,-216,11160 );
players[i] setplayerangles( 0,135,0 );
players[i].spectator_respawn = structs[i];
break;
}
}
}

Double Post Merge: October 31, 2014, 02:40:02 pm
ok, no more necessary