UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Doodles_Inc on July 08, 2018, 01:50:41 am

Title: Deactivate risers
Post by: Doodles_Inc on July 08, 2018, 01:50:41 am
Is there any way I can deactivate a riser/spawner? Or any way to make zombies spawn only in the zone players are? Im making a map that has a moving wall wich will start closing the map, so I need zombies to stop spawning on the closed areas.
Thanks.
Title: Re: Deactivate risers
Post by: isaacscott935 on July 08, 2018, 10:09:04 am
To deactivate a riser, all you need to do is delete the script_struct that the zombies are spawning from and remove the:

Code Snippet
Plaintext
script_string     riser

from your zombies' KVPs.

For deleting zombies which are in closed areas, I'm pretty sure you can use:

Code Snippet
Plaintext
zombie_spawn = getEntArray("zone_name_spawners","targetname");
zone = getEnt("zone_name","targetname");

if ( zombie_spawn istouching( zone ) )
{
      zombie_spawn Delete();
}

I'm pretty sure that will work. I haven't actually tested it though.
Title: Re: Deactivate risers
Post by: Harry Bo21 on July 08, 2018, 12:26:41 pm
Can’t use getentarray on structs...
Title: Re: Deactivate risers
Post by: isaacscott935 on July 08, 2018, 12:47:59 pm
Can’t use getentarray on structs...

Scheiße

Double Post Merge: July 08, 2018, 12:54:45 pm
Can’t use getentarray on structs...

I wasn't using getEntArray on a struct, I was using it on the zombie spawner entities.

Title: Re: Deactivate risers
Post by: Doodles_Inc on July 08, 2018, 06:53:10 pm
Ok I will test this now.

Double Post Merge: July 08, 2018, 07:18:34 pm
Scheiße

Double Post Merge: July 08, 2018, 12:54:45 pm
I wasn't using getEntArray on a struct, I was using it on the zombie spawner entities.
Hey, so are we deleting the spawners or the risers? I just have one spawner in my map wich is the The Giant one.
Title: Re: Deactivate risers
Post by: isaacscott935 on July 08, 2018, 07:22:19 pm
Delete the struct which the zombies are spawning from.

And then remove the script_string from the zombie spawner.

Also, why don’t you want risers? Without them, they will just appear in the map without an animation.
Title: Re: Deactivate risers
Post by: Doodles_Inc on July 08, 2018, 07:35:56 pm
Delete the struct which the zombies are spawning from.

And then remove the script_string from the zombie spawner.

Also, why don’t you want risers? Without them, they will just appear in the map without an animation.
Okay so I think I am mixing things, for me the riser is where the zombies spawn and the spawner in what set's wich model of zombie will spawn.
(https://i.imgur.com/qlY5Zbt.png)(https://i.imgur.com/dV5pXEs.png)
I didn't understand wich one of these the code should delete, as HarryBo said I can't get the a array of structs, but, I just have one spawner, so how could I set a spawner per zone?

Double Post Merge: July 08, 2018, 07:41:00 pm
Delete the struct which the zombies are spawning from.

And then remove the script_string from the zombie spawner.

Also, why don’t you want risers? Without them, they will just appear in the map without an animation.
Also, how would I remove the script_string from the spawner?
Title: Re: Deactivate risers
Post by: isaacscott935 on July 08, 2018, 08:14:32 pm
Okay so I think I am mixing things, for me the riser is where the zombies spawn and the spawner in what set's wich model of zombie will spawn.
(https://i.imgur.com/qlY5Zbt.png)(https://i.imgur.com/dV5pXEs.png)
I didn't understand wich one of these the code should delete, as HarryBo said I can't get the a array of structs, but, I just have one spawner, so how could I set a spawner per zone?

Double Post Merge: July 08, 2018, 07:41:00 pm
Also, how would I remove the script_string from the spawner?

Just delete the script_struct (the red box). I realised there’s no need to remove any KVPs.

Now in the script, add:

Code Snippet
Plaintext
zombie_spawn = getEnt("zone_name_spawners","targetname");
zone = getEnt("zone_name","targetname");

if ( zombie_spawn istouching( zone ) )
{
      zombie_spawn Delete();
}




Double Post Merge: July 08, 2018, 08:16:00 pm
To get one spawner per zone just duplicate the zombie spawner but with each duplicate, change the name of the zone in the targetname.
Title: Re: Deactivate risers
Post by: Doodles_Inc on July 08, 2018, 08:46:48 pm
Just delete the script_struct (the red box). I realised there’s no need to remove any KVPs.

Now in the script, add:

Code Snippet
Plaintext
zombie_spawn = getEnt("zone_name_spawners","targetname");
zone = getEnt("zone_name","targetname");

if ( zombie_spawn istouching( zone ) )
{
      zombie_spawn Delete();
}




Double Post Merge: July 08, 2018, 08:16:00 pm
To get one spawner per zone just duplicate the zombie spawner but with each duplicate, change the name of the zone in the targetname.
Okay, so the code works, but the zombies don't really stop spawning.
(https://i.imgur.com/9DzrsRI.png)(https://i.imgur.com/wplT5hz.png)(https://i.imgur.com/a5VKlT4.png)(https://i.imgur.com/r6JdvKl.png) - As you can see the round passes but zombies continue spawning on the risers that should have been deleted, OBS: My character changes because I had to restart the level to get both screenshots.

Double Post Merge: July 08, 2018, 08:55:08 pm
I also tested trying to get the EntArray for the structs but no success also.
Title: Re: Deactivate risers
Post by: Harry Bo21 on July 09, 2018, 06:23:29 am
He doesn’t know what he’s doing...

This is bo3 not waw - there is only one spawner and the structs / spawners wouldn’t necessarily be touching the zone volume anyway - PLUS a zone can be multiple volumes your only checking one...

Check zm_zonemgr.gsc - there’s “actual code” to disable riser points... struct.is_enabled or something if I recall
Title: Re: Deactivate risers
Post by: isaacscott935 on July 09, 2018, 03:05:07 pm
He doesn’t know what he’s doing...

This is bo3 not waw - there is only one spawner and the structs / spawners wouldn’t necessarily be touching the zone volume anyway - PLUS a zone can be multiple volumes your only checking one...

Check zm_zonemgr.gsc - there’s “actual code” to disable riser points... struct.is_enabled or something if I recall

I don’t use BO3. There’s no need to be so contemptuous just because I got something wrong lol.
Title: Re: Deactivate risers
Post by: Doodles_Inc on July 09, 2018, 11:21:59 pm
He doesn’t know what he’s doing...

This is bo3 not waw - there is only one spawner and the structs / spawners wouldn’t necessarily be touching the zone volume anyway - PLUS a zone can be multiple volumes your only checking one...

Check zm_zonemgr.gsc - there’s “actual code” to disable riser points... struct.is_enabled or something if I recall
Ok thans I will search on that and try something.

Double Post Merge: July 09, 2018, 11:31:32 pm
Ok, so I didn't find that specific function BUT I found a function named enable_zone wich controls the variable for the zone "spawning_allowed", maybe I can make a disable_zone function wich set's spawning allowed for false. Gonna try it now.

Double Post Merge: July 09, 2018, 11:38:45 pm
(https://i.imgur.com/a9yJtVu.png) This is the original function.
(https://i.imgur.com/zHuwsbO.png) This is the disable one I just made.
(https://i.imgur.com/yC7BdaB.png) Calling it from the .gsc like this.
(https://i.imgur.com/M2t5ccH.png) No errors, gonna test it now.


Double Post Merge: July 09, 2018, 11:41:09 pm
(https://i.imgur.com/jQME65i.png)

Ok, so I got a error, someone knows what I'm doing wrong?

Double Post Merge: July 09, 2018, 11:43:25 pm
(https://i.imgur.com/BQm7C6A.png)

Gonna try doing it directly from the GSC.

Double Post Merge: July 09, 2018, 11:51:12 pm
It fucking worked, thanks for all of you that helped, respect+.
Title: Re: Deactivate risers
Post by: Harry Bo21 on July 10, 2018, 03:06:34 am
I don’t use BO3. There’s no need to be so contemptuous just because I got something wrong lol.
then dont try to answer questions in the BLACK OPS 3 helpdesk
Title: Re: Deactivate risers
Post by: isaacscott935 on July 10, 2018, 06:16:26 am
I was just trying to help. You don’t need to just bring others down.
Title: Re: Deactivate risers
Post by: Doodles_Inc on July 10, 2018, 06:05:21 pm
Lol stop fighting we are a community.

Just a cool thing that I discovered, it is actually possible to get a array of strucs, you just need to use the struct namespace, like this:
Code Snippet
Plaintext
#using scripts\codescripts\struct;
structs = struct::get_array("something", "targetname");
Could've used it for my script.
Title: Re: Deactivate risers
Post by: Harry Bo21 on July 12, 2018, 03:47:33 am
i know - hence why i said do not use getentarray

its not a ent, its a struct

even in waw it was getStruct / getStructArray

bo3 moved this in to the _struct gsc/csc


and i wasnt "putting you down" - i said trying to help on something you havent even looked at is nothing but counter productive - you had this guy chasing ghosts