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

spawn boss from specific place

broken avatar :(
Created 6 years ago
by nikfar1
0 Members and 1 Guest are viewing this topic.
1,738 views
broken avatar :(
×
broken avatar :(
Location: 00persia
Date Registered: 20 December 2012
Last active: 1 year ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
nikfar1's Groups
nikfar1's Contact & Social Links
hi
I have a boss zombie in my map and I want to spawn from specific point(rise from well)
in this script the boss spawn from every riser zombie near to player

spawn script code:

Code Snippet
Plaintext
lionBoss_init()
{

preCacheModel ("lion_b");

if (isdefined(level.lion_next) ) return;
else
{
    lion_trig = getEnt("lion_trig1", "targetname");
lion_trig sethintstring("Press &&1 to spawn");
    lion_trig waittill("trigger");
wait(.4);
lion_trig delete();

wait 1;
spawn_point = undefined; use_spawn_point = undefined;
teh_spawns = undefined;
level.lion_next = 0;
while(true)   
{
while(isdefined(level.doground_nomusic) && level.doground_nomusic == 1) wait 5;
for(am=0;am<50;am++)
{
wait .05;
teh_spawns = level.enemy_spawns;
for(t=0;t<teh_spawns.size;t++)
{
wait .05;
use_spawn_point = teh_spawns[t]; spawn points from riser
if (use_spawn_point.script_noteworthy == "find_flesh") break; // Assure its a riser spawn before continuing
}
spawn_points = GetStructArray("find_flesh","script_noteworthy");
spawn_point = spawn_points[0];
// if (isdefined(spawn_point)) iprintln(spawn_point.origin);
else iprintln("^1NO SPAWN POINT FOUND");
if (spawn_point inMap() && isdefined(spawn_point) ) { break; }
}

ai = spawn_zombie( use_spawn_point );
wait .05;
ai forceTeleport(spawn_point.origin);
ai.boss_enemy = true;
wait .05;
ai DetachAll(); ai attach("char_ger_ansel_head_zomb", "", true);
ai setModel("lion_b");
ai.health = level.zombie_health+randomintrange(6500,8550); wait .05; ai.lion_max_health = ai.health;
if (randomint(100) < 50) ai thread lionBoss_forcewalk(); else ai thread lionBoss_forcewalk(true);
if (randomInt(100) < 50) level.lion_next = 1; else { if (randomInt(100) < 50) level.lion_next = 2; else level.lion_next = 0; }
while(isdefined(ai) ) wait 1;
}
}
}

how to spawn it from one point?
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
If you only need 1 struct for the boss you can add a kvp on a working riser struct
"script_personality" "nikfarboss"
Then in gsc you can use
getstruct("script_personality","nikfarboss");

If you want multiple boss structs then use getstructarray and pick a random single struct from the array.
broken avatar :(
×
broken avatar :(
Location: 00persia
Date Registered: 20 December 2012
Last active: 1 year ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
nikfar1's Groups
nikfar1's Contact & Social Links
thanks a lot codmoddd1234
I changed this line as you said:
Code Snippet
Plaintext
spawn_points = GetStructArray("find_flesh","script_noteworthy");
to this:

Code Snippet
Plaintext
spawn_points = GetStructArray("nikfarboss","script_personality");

and the boss spawned from this point but 15 second after activating him.
this lag of time for spawning happens after change this line
why this Delay happened?
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
Probably this.

for(t=0;t<teh_spawns.size;t++)
{
wait .05;

You dont need to sort the all the spawns now. Just get the struct and then spawn the ai.
There is also wait 4; after the trigger is used.
broken avatar :(
×
broken avatar :(
Location: 00persia
Date Registered: 20 December 2012
Last active: 1 year ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
nikfar1's Groups
nikfar1's Contact & Social Links
thanks for your help
I changed "50" in this line to 2 and time fixed.  (for(am=0;am<2;am++)
but my first problem repaet again and the boss spawned from another place( this is not related to time problem). :'(
and changing  this line was useless.( spawn_points = GetStructArray("nikfarboss","script_personality");  )
I still have spawning from everywhere..
please     h     e      l     p


Spoiler: click to open...
sorry I thought my first problem was fixed

Last Edit: July 29, 2018, 08:11:24 pm by nikfar1
Marked as best answer by nikfar1 6 years ago
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
if you are using a regular zombie spawner and then changing the model it probably still uses "add_spawn_function" to "zombie_rise" from zombiemode_spawner.gsc
//
Ill post a working solution when im home but if you want to try yourself then check in zombiemode_spawner do_zombie_rise() find where the script selects a random spot, check if self is the lion guy, and pick your new spot.
broken avatar :(
×
broken avatar :(
Location: 00persia
Date Registered: 20 December 2012
Last active: 1 year ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
nikfar1's Groups
nikfar1's Contact & Social Links
Thank you for your all help.I am not home.I ll test it later.

 
Loading ...