UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: dextro62 on April 01, 2016, 11:18:51 pm

Title: Shootable Door Problem
Post by: dextro62 on April 01, 2016, 11:18:51 pm
Hey I followed a tutorial for a shootable door and i got the door to open by shooting it no problem but once i open it and walk through the zombies are unable to follow me through it and just stand still.


The script goes in root\mods\mapname\maps\mapname.gsc


I placed this at the bottom of the file
Code Snippet
Plaintext
//ZK's Shootable Opening Door
zk_shootable_door()
{
        door = getEnt("shootable_door", "targetname");  //this will be the door that opens
        shoot_me = getEnt("shoot_me", "targetname");    //this is the trigger that you shoot
 
 
        shoot_me waittill("trigger");
        shoot_me delete();
        play_sound_at_pos("door_slide_open", door.origin);
        door MoveZ (084, 1);
        //door MoveY (100, 5);
        //door MoveX (100, 5);
  iprintln("A Secret Is Revealed");     //remove this line if you don't want it to say that
       
        wait 1;
}

And i placed this:


Code Snippet
Plaintext
thread zk_shootable_door();

Below this:
Code Snippet
Plaintext
	/*--------------------
FUNCTION CALLS - PRE _Load
----------------------*/
level thread DLC3_threadCalls();


I then went into radiant and made a script brushmodel and gave it the KVP targetname/shootable_door
And I made a trigger damage with the KVP targetname/shoot_me


Here's a link to the original tutorial:   http://www.youtube.com/watch?v=2gM7MxdwIwI (http://www.youtube.com/watch?v=2gM7MxdwIwI)


If anyone can tell me why the zombies are acting like this that would be great.
Title: Re: Shootable Door Problem
Post by: Dust on April 02, 2016, 12:40:01 am
That tutorial did not include the connectpaths or setting the zone flag which is why it didnt work.

Added it into the script. Just copy and replace.

Code Snippet
Plaintext
//ZK's Shootable Opening Door
zk_shootable_door()
{
        door = getEnt("shootable_door", "targetname");  //this will be the door that opens
        shoot_me = getEnt("shoot_me", "targetname");    //this is the trigger that you shoot
 
 
        shoot_me waittill("trigger");
if( IsDefined( shoot_me.script_flag ) )
{
flag_set( shoot_me.script_flag );
}
else
{
iprintlnbold("Did not set the script flag on the trigger properly.");
}
        shoot_me delete();
        play_sound_at_pos("door_slide_open", door.origin);
        door MoveZ (084, 1);
        //door MoveY (100, 5);
        //door MoveX (100, 5);
door connectpaths();
  iprintln("A Secret Is Revealed");     //remove this line if you don't want it to say that

       
        wait 1;
}

On the trigger of the door make sure it has script_flag and the name of the zone(like you do for every other normal door). Also add the zone_volume etc for the zone.
Title: Re: Shootable Door Problem
Post by: dextro62 on April 02, 2016, 04:08:40 pm
That tutorial did not include the connectpaths or setting the zone flag which is why it didnt work.

Hey i tried what you said but when the door opens the zombies still just stand still or sometimes they walk towards the door and try to get through but it's like there is something blocking them.

I don't get the "Did not set the script flag on the trigger properly." message. So I don't know what's going on.
Title: Re: Shootable Door Problem
Post by: Dust on April 02, 2016, 04:58:43 pm
Hey i tried what you said but when the door opens the zombies still just stand still or sometimes they walk towards the door and try to get through but it's like there is something blocking them.

I don't get the "Did not set the script flag on the trigger properly." message. So I don't know what's going on.

Have you added pathnodes going into the new zone?
Title: Re: Shootable Door Problem
Post by: Harry Bo21 on April 02, 2016, 04:59:22 pm
and set up the second zone in mapname.gsc
Title: Re: Shootable Door Problem
Post by: MakeCents on April 02, 2016, 06:18:36 pm
Make sure dynamic path was selected on the door, that there isn't a mon clip there, and then post a pic of radiant that shows the door and pathnodes.

And in game in console use the following
developer 1
ai_showpaths 1
ai_shownodes 1

And take a pic of that (ctrl+alt+ print screen will take a pic to clip board and then you can post it, or use gyazo or something)

Here is a thing I made a while ago if it helps
https://ugx-mods.com/forum/index.php/topic,4508.msg49909.html#msg49909
Title: Re: Shootable Door Problem
Post by: dextro62 on April 02, 2016, 11:37:37 pm
I didn't have dynamic path selected on the door so i ticked that and it's working now.
Thanks for all your help
Title: Re: Shootable Door Problem
Post by: Dust on April 03, 2016, 12:24:39 am
I didn't have dynamic path selected on the door so i ticked that and it's working now.
Thanks for all your help

Ah ya totally forgot about the dynamic path checkbox.

Glad you got it working :)