Page 1 of 3
Texture question
Posted: September 4th, 2012, 11:11 am
by darkpheonixz4x
How do you make a part of a brush or a whole brush that allows you to go through it? It's very common in deathrun and I thought i would add that for my map. I also want to know how you can script to make it go through after a trigger. Thanks
darkpheonixz4x
Re: Texture question
Posted: September 4th, 2012, 11:18 am
by Rezil
In radiant by right clicking on the selected brush and setting it to 'non-coliding'. If you want it to be a bit more flexible you have to create a brushmodel and call 'notsolid()' on it in code.
Re: Texture question
Posted: September 4th, 2012, 11:23 am
by darkpheonixz4x
Thank you,
Lets say i make the brushmodel with targetname brush1.
To make it non-colliding with the script, it would be brush1 notsolid;
Is that right?
Re: Texture question
Posted: September 4th, 2012, 11:29 am
by Rezil
Code: Select all
getEnt("brush1","targetname") notsolid();
This should work wherever you decide to place it in your .gsc file.
Re: Texture question
Posted: September 4th, 2012, 12:18 pm
by darkpheonixz4x
Okay here is my script for my trap.
Code: Select all
main()
{
thread platform_hollow();
}
platform_hollow()
{
trig = getEnt("trig_trap2","targetname");
{
trig waittill ("trigger");
}
}
My brush that I want to get hollow after the trigger is trap2_plat1. Where do i add it? If i had it right after trig = getEnt... wouldn't it always be hollow?
Re: Texture question
Posted: September 4th, 2012, 12:30 pm
by Rezil
Code: Select all
main()
{
    thread platform_hollow();
}
Â
platform_hollow()
{
    trig = getEnt("trig_trap2","targetname");
    {
        trig waittill ("trigger");
        getEnt("brush1","targetname") notsolid();
    }
}
The brush will be set to 'not solid' only after the player has triggered the 'trig' entity.
Re: Texture question
Posted: September 4th, 2012, 12:52 pm
by darkpheonixz4x
Thank you for this.
I tried this, but i get Undefined is not an object. The error is on line 10 and i have rechecked a million times that the targetnames are the same. Any ideas??
Re: Texture question
Posted: September 4th, 2012, 1:00 pm
by Drofder2004
Open your map in radiant and check the spelling of your entity key and value.
Re: Texture question
Posted: September 5th, 2012, 7:24 am
by darkpheonixz4x
Thanks, but the original trigger doesn't work itself. The map runs fine, no errors but the triggers don't work as well as the hintstring doesn't show. Only this one doesn't work. Any ideas of what to do?
Re: Texture question
Posted: September 5th, 2012, 12:07 pm
by Rezil
How do you create your trigger?
Re: Texture question
Posted: September 5th, 2012, 12:43 pm
by darkpheonixz4x
Made a trigger brush, right click < Trigger_use. Enter its key/values.
Re: Texture question
Posted: September 5th, 2012, 6:12 pm
by Rezil
Hm, does it give a script error or does the trigger disappear when you play the map(still visible in radiant though)?
Re: Texture question
Posted: September 5th, 2012, 8:35 pm
by Drofder2004
Post screenshots of the entity window and the brush selected.
Re: Texture question
Posted: September 6th, 2012, 5:22 am
by darkpheonixz4x
Okay here is the screenshot and the script i made for it.
Code: Select all
trap_1()
{
bounce = getEnt( "trap1_bounce" , "targetname" );
trig = getEnt( "decision_trap1_trig" , "targetname" );
while( isDefined( bounce ) && isDefined( trig ) )
{
trig waittill( "trigger" , player );
if( isDefined( player ) && isPlayer( player ) )
player iPrintLn( "You triggered decision_trap1_trig and activated trap1_bounce" );
bounce rotatePitch( -90 , 1 , 0 , 0 );
bounce waittill( "rotatedone" );
wait( 5 );
bounce rotatePitch( 90 , 5 , 0 , 0 );
}
in main(), I put thread trap_1();
And the screenshot is attached.
Re: Texture question
Posted: September 6th, 2012, 3:07 pm
by Drofder2004
Change
Code: Select all
while( isDefined( bounce ) && isDefined( trig ) )
To
At this current moment, we are not going to see the errors because you will bypass them with the above code.
Removing checks for "defines" will flag errors for undefined entities.