UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: death_reaper0 on April 03, 2018, 04:43:24 pm

Title: spawning zombie clips via script
Post by: death_reaper0 on April 03, 2018, 04:43:24 pm
before i continue, i CAN NOT use radiant for this, my only option is a script change (spawning models etc)

so i need to place a clip that blocks zombies and need to make them walk around, ive already spawned a collision model to block out players from passing through a solid object ive spawned but zombies just walk through this, is there any way to stop this? ive tried changing stuff in asset manager in "special surface properties" but they didnt really seem to do anything.
thanks if you can help
Title: Re: spawning zombie clips via script
Post by: buttkicker845 on April 03, 2018, 06:02:24 pm
you can call disconnectPaths which disconnects the AI Paths that are intersecting the entity which should keep them from walking straight through the object. I'm pretty sure the only reason the "Monster_Clip" works from radiant is because it blocks the navMesh during compiling
Code Snippet
Plaintext
entity DisconnectPaths();

AI have a slight ability to navigate off of the navMesh so it's still possible they might walk through your object depending on how big it is.
Title: Re: spawning zombie clips via script
Post by: death_reaper0 on April 03, 2018, 09:55:17 pm
unfortunately that doesnt work on script models
Title: Re: spawning zombie clips via script
Post by: Harry Bo21 on April 04, 2018, 12:56:18 am
Yes it does. Any entity
Title: Re: spawning zombie clips via script
Post by: death_reaper0 on April 04, 2018, 08:19:44 am
when i did it, it gave me an error though
(https://i.imgur.com/bC1H96s.png)
Title: Re: spawning zombie clips via script
Post by: Harry Bo21 on April 04, 2018, 09:21:08 am
Huh, ok I stand corrected
Title: Re: spawning zombie clips via script
Post by: codmoddd1234 on April 04, 2018, 09:24:29 am
This works if the map has script_brushmodels for doors, or clips with script_noteworthy clip (anything made from a script_brushmodel with spawnflags 1)
Get the first set of doors and door.targets in zombiemode_blockers_new.gsc door_think(). Thread them to another function thats just a copy of door_think() except when the door/clip is purchased use connectpaths(), then instead of deleting the door or clip Moveto new origin, Disconnectpaths().
Title: Re: spawning zombie clips via script
Post by: death_reaper0 on April 04, 2018, 06:54:36 pm
This works if the map has script_brushmodels for doors, or clips with script_noteworthy clip (anything made from a script_brushmodel with spawnflags 1)
Get the first set of doors and door.targets in zombiemode_blockers_new.gsc door_think(). Thread them to another function thats just a copy of door_think() except when the door/clip is purchased use connectpaths(), then instead of deleting the door or clip Moveto new origin, Disconnectpaths().
im sure there wouldnt be one of the right shape, on top of that one of the items im trying to clip is is the spawn room
Title: Re: spawning zombie clips via script
Post by: Harry Bo21 on April 04, 2018, 07:00:51 pm
Doubt it but does it work on a trigger radius
Title: Re: spawning zombie clips via script
Post by: death_reaper0 on April 04, 2018, 08:20:40 pm
nope, really i just need something spawnable thats around the size of the player that disconnects paths

Double Post Merge: April 04, 2018, 08:36:11 pm
probably a stupid idea but what if i spawned an invisible zombie inside of the solid object thats invincible and unaffected by powerups etc that just sits there, zombies should try to walk around him and avoid the "solid" object
Title: Re: spawning zombie clips via script
Post by: StupidEdits on April 05, 2018, 05:03:55 am
Maybe this could work
Code Snippet
Plaintext
badPlace_cylinder( <name>, <duration>, <origin>, <radius>, <height>, <team> );
Title: Re: spawning zombie clips via script
Post by: death_reaper0 on April 05, 2018, 10:04:37 am
Maybe this could work
Code Snippet
Plaintext
badPlace_cylinder( <name>, <duration>, <origin>, <radius>, <height>, <team> );
im probably using it wrong or its just not compatible but it didnt work unfortunately
Title: Re: spawning zombie clips via script
Post by: buttkicker845 on April 05, 2018, 11:49:09 am
it probably didn't work because of this line in the zombie_spawn_init function.
Code Snippet
Plaintext
self.badplaceawareness = 0;
From the description, it won't disconnect the paths but it will help the AI avoid the area if they can.
Title: Re: spawning zombie clips via script
Post by: codmoddd1234 on April 05, 2018, 01:38:40 pm
This also worked.
Spawn a trig with 4 script_origins offset (front back left right). In a loop check if zombie istouching trig, get an array of closest origins to the zombie. 0 will be closest, [1] and [2] should be left and right of the zombies current position, [3] would be the farthest. Zombie notify stop_find_flesh and zombie notify zombie_acquire_enemy, send to origin [1] or [2], thread find_flesh.
I would also add a check for the last spot they were so they don't keep going back and forth between the origins but move around the object.
Title: Re: spawning zombie clips via script
Post by: death_reaper0 on April 05, 2018, 11:37:45 pm
it probably didn't work because of this line in the zombie_spawn_init function.
Code Snippet
Plaintext
self.badplaceawareness = 0;
From the description, it won't disconnect the paths but it will help the AI avoid the area if they can.
i set up a loop if a zombie comes close enough to one of these "solid" objects they get the awareness switched to 1 then 0 when theyre away but it doesnt seem to work everytime, some zombies walk into the object then as an attempt to get away will continue through it then chase the player when theyre on the other side. i'll see if i can fine tune it though

Double Post Merge: April 05, 2018, 11:38:35 pm
This also worked.
Spawn a trig with 4 script_origins offset (front back left right). In a loop check if zombie istouching trig, get an array of closest origins to the zombie. 0 will be closest, [1] and [2] should be left and right of the zombies current position, [3] would be the farthest. Zombie notify stop_find_flesh and zombie notify zombie_acquire_enemy, send to origin [1] or [2], thread find_flesh.
I would also add a check for the last spot they were so they don't keep going back and forth between the origins but move around the object.
from what ive seen the thing above seems to do pretty much this with less hassle
Title: Re: spawning zombie clips via script
Post by: mapping_noob on April 06, 2018, 03:38:08 am
Do u think having a model use the clip material would stop players and zombies from walking through?

Double Post Merge: April 06, 2018, 03:38:47 am
Do u think having a model use the clip material would stop players and zombies from walking through?

Didn’t know if the material properties would change anything
Title: Re: spawning zombie clips via script
Post by: Harry Bo21 on April 06, 2018, 03:54:49 am
no that will not work