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

Spawning near players

HOT
broken avatar :(
Created 11 years ago
by HitmanVere
0 Members and 1 Guest are viewing this topic.
5,516 views
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I dont know, if this is mapping or scripting issue. I want it so when player goes down, he spawns near other players and not where he spawned, cos I find it annoying spawning at spawn always
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
I dont know, if this is mapping or scripting issue. I want it so when player goes down, he spawns near other players and not where he spawned, cos I find it annoying spawning at spawn always
It's setup in the stock scripts already, you just need to add the spawn structs for each zone.

Code Snippet
Plaintext
check_for_valid_spawn_near_team( revivee )
{

players = get_players();
spawn_points = getstructarray("player_respawn_point", "targetname");

if( spawn_points.size == 0 )
return undefined;

for( i = 0; i < players.size; i++ )
{
if( is_player_valid( players[i] ) )
{
for( j = 0 ; j < spawn_points.size; j++ )
{
if( DistanceSquared( players[i].origin, spawn_points[j].origin ) < ( 1000 * 1000 ) && spawn_points[j].locked == false )
{
spawn_array = getstructarray( spawn_points[j].target, "targetname" );

for( k = 0; k < spawn_array.size; k++ )
{
if( spawn_array[k].script_int == (revivee.entity_num + 1) )
{
return spawn_array[k].origin;
}
}

return spawn_array[0].origin;
}

}

}

}

return undefined;

}
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
It's setup in the stock scripts already, you just need to add the spawn structs for each zone.

Code Snippet
Plaintext
check_for_valid_spawn_near_team( revivee )
{

players = get_players();
spawn_points = getstructarray("player_respawn_point", "targetname");

if( spawn_points.size == 0 )
return undefined;

for( i = 0; i < players.size; i++ )
{
if( is_player_valid( players[i] ) )
{
for( j = 0 ; j < spawn_points.size; j++ )
{
if( DistanceSquared( players[i].origin, spawn_points[j].origin ) < ( 1000 * 1000 ) && spawn_points[j].locked == false )
{
spawn_array = getstructarray( spawn_points[j].target, "targetname" );

for( k = 0; k < spawn_array.size; k++ )
{
if( spawn_array[k].script_int == (revivee.entity_num + 1) )
{
return spawn_array[k].origin;
}
}

return spawn_array[0].origin;
}

}

}

}

return undefined;

}

Last time I tried, it didnt work. Going to try again when I can
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
zones needs script_noteworthy - player_zone for that to work correctly i believe

Other wise it defaults to "initial" spawn ;)
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
This is what i get from reading through it, never used it myself like this though.
Looks ilke the respawn structs, these:

Code Snippet
Plaintext
spawn_points = getstructarray("player_respawn_point", "targetname");

Get unlocked by the zone_manager, however after that it looks for the targets of these structs?

Code Snippet
Plaintext
spawn_array = getstructarray( spawn_points[j].target, "targetname" );

And it looks like they need a kvp to get linked to a player-number:

Code Snippet
Plaintext
spawn_array[k].script_int == (revivee.entity_num + 1)



. So my guess would be first a sctruct with the KVP

Code Snippet
Plaintext
"player_respawn_point", "targetname"

and then make that struct target 4 other structs( by pressing W ) with the kvp's:

Code Snippet
Plaintext
script_int -  1 
script_int -  2
script_int -  3
script_int -  4
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I believe the respawn struct needs a script_noteworthy kvp the same as the zone it is in too, does it not? For the zone manager to unlock it? I never noticed the target part though...

I've never done this either.


The other thing I noticed is it seemed to be set to 1000 distance from a player. I think this could be rewritten to just get the closest active struct maybe to help. At least that is what I thought my friends issue could be...
Last Edit: June 02, 2015, 01:36:16 pm by MakeCents
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
http://www.zombiemodding.com/index.php?topic=9674.msg106816#msg106816

Oh, cool, that seems pretty easy. He doesn't mention anything about the distance being an issue in there. Anyone know if that plays a part?

Edit: Just noticed it says 1000 * 1000, so that prob isn't his issue then...
Last Edit: June 02, 2015, 12:29:35 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
Edit: Just noticed it says 1000 * 1000, so that prob isn't his issue then...

It distanceSQUARED, so the max distance for a struct to be chosen is still max 1000 units
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
It distanceSQUARED, so the max distance for a struct to be chosen is still max 1000 units

Lol, that shit always confuses me. I was thinking that but decided to just go with it.  :D So this could be an issue then?
Last Edit: June 02, 2015, 01:02:55 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
Lol, that shit always confuses me. I was thinking that but decided to just go with it.  :D So this could be an issue then?

Often Squared is used because thats easier ro calculate because it involve's no root (i think is the correct word ). You could obv just increase the numbers in the script or place more respawns.. easiest solution prob
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Often Squared is used because thats easier ro calculate because it involve's no root (i think is the correct word ). You could obv just increase the numbers in the script or place more respawns.. easiest solution prob

Thanks man, but that would be too easy, lol. Should solve the issues some people are having I think with it appearing to inconsistently work. It does appear that it could be an issue so I think I will rewrite it to just get an array of ones not locked then get the closest one of them. It seems the more manageable way in the long run and would only require one setup per zone that way and I wouldn't have to worry about consistent distances.

Last Edit: June 02, 2015, 01:37:02 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
yea no script noteworthy required, it uses is_in_zone() to search for structs that are inside or touching that zone i belive, just need the player_zone kvp on the zone so that function works

Would be cool if you did rewrite it though, as a lot of people dont realize this is there at all XD
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
yea no script noteworthy required, it uses is_in_zone() to search for structs that are inside or touching that zone i belive, just need the player_zone kvp on the zone so that function works

Would be cool if you did rewrite it though, as a lot of people dont realize this is there at all XD

Where do you see this? I am not finding is_in_zone() anywhere. According to this I would think script_noteworthy would be needed:

Code Snippet
Plaintext
enable_zone( zone_name )
{
level.zones[ zone_name ].is_enabled = true;

// activate any player spawn points
spawn_points = getstructarray("player_respawn_point", "targetname");
for( i = 0; i < spawn_points.size; i++ )
{
if ( spawn_points[i].script_noteworthy == zone_name )
{
spawn_points[i].locked = false;
}
}

activate_barrier_goals( zone_name+"_barriers", "script_noteworthy" );
}

which I found in zone_manager

Is this one of those differences in tools or script placer or something I see from time to time? Maybe you have an edited zone_manager? Perhaps used for the zone debugging in UGX mod tools or something?
Last Edit: June 03, 2015, 01:48:08 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
lol Actually i think its just another example of my poor memory lol

My bad ;)

 
Loading ...