Hiding/Un-hiding is it Possible???
Moderator: Moderators
Hiding/Un-hiding is it Possible???
Would it be possible to use a trigger to hide/unhide things, i.e. if i walk to a location go through the trigger and something appears behind you. I'f so this would be very cool for my next Top Secret Map Plans 8)
Thanks
Thanks
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
heh. I know exactly how you would go about this.
1. Create a trigger_multiple and give it a targetname of thetrigger.
2. Then create the object that you want to show/hide and give it a targetname of theobject.
3. In your .scr file, put in this code after level waittill spawn :
thread show_setup
end
show_setup:
$thetrigger waittill trigger
$theobject show
thread hide_setup
end
hide_setup:
$thetrigger waittill trigger
$theobject hide
thread show_setup
end
That should do it. Step in and out of the trigger to show and hide the object you want. Let me know if there is any other complications.
And jv, make sure I got it right this time. hehe
1. Create a trigger_multiple and give it a targetname of thetrigger.
2. Then create the object that you want to show/hide and give it a targetname of theobject.
3. In your .scr file, put in this code after level waittill spawn :
thread show_setup
end
show_setup:
$thetrigger waittill trigger
$theobject show
thread hide_setup
end
hide_setup:
$thetrigger waittill trigger
$theobject hide
thread show_setup
end
That should do it. Step in and out of the trigger to show and hide the object you want. Let me know if there is any other complications.
And jv, make sure I got it right this time. hehe
Cool thanks - if what im hoping to do works i'll put a little test map up
if i cant get it to work ill let u know my idea and maybe some1 else can crack it.......
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
You're a champion in dodgy code PowellMPowell1944 wrote: thread show_setup
end
show_setup:
$thetrigger waittill trigger
$theobject show
thread hide_setup
end
hide_setup:
$thetrigger waittill trigger
$theobject hide
thread show_setup
end
And jv, make sure I got it right this time. hehe
This is what you want - right? You can now easily see the code loops forever:
Code: Select all
while(1)
{
$thetrigger waittill trigger
$theobject show
wait 2
$thetrigger waittill trigger
$theobject hide
}
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
Directed at Shifty :
*Edit. Shifty I forgot to tell you to add $theobject hide after level waittill spawn in the first script I gave you. Just a heads up.*
I am the one that created working lights, and that involved showing and hiding the light and the corona, so I am positive that this will work. You can use different names if you want, I just used those as an example. Also, if you just want the object to show once and not have it show/hide, you can use these steps instead :
1. Create a trigger_multiple and give it a targetname of thetrigger and a setthread of showobject.
2. Then create the object that you want to show/hide and give it a targetname of theobject.
3. In your .scr file, put in this code after level waittill spawn :
$theobject hide
end
showobject:
$theobject show
$thetrigger remove
end
Directed at jv :
Your script is refined, and I know that mine threads other scripts, but I did this with my lights and it worked flawlessly. Oh and by the way, I finally caught a mistake you made. You have it to show from the beginning, but without it being hidden in the first place, you would have to reverse the script. No big deal, just pickin' on you.
*Edit. Shifty I forgot to tell you to add $theobject hide after level waittill spawn in the first script I gave you. Just a heads up.*
I am the one that created working lights, and that involved showing and hiding the light and the corona, so I am positive that this will work. You can use different names if you want, I just used those as an example. Also, if you just want the object to show once and not have it show/hide, you can use these steps instead :
1. Create a trigger_multiple and give it a targetname of thetrigger and a setthread of showobject.
2. Then create the object that you want to show/hide and give it a targetname of theobject.
3. In your .scr file, put in this code after level waittill spawn :
$theobject hide
end
showobject:
$theobject show
$thetrigger remove
end
Directed at jv :
Your script is refined, and I know that mine threads other scripts, but I did this with my lights and it worked flawlessly. Oh and by the way, I finally caught a mistake you made. You have it to show from the beginning, but without it being hidden in the first place, you would have to reverse the script. No big deal, just pickin' on you.
Last edited by MPowell1944 on Mon Mar 10, 2003 6:35 pm, edited 1 time in total.
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
Ok, so the threads work, one way or the other. Isn't just safe to make any 'walk-into' trigger as small as possible to eliminate any camping inside it and freaking the trigger??? As for lights and other 'switch' related things, I'd guess making a moving switch would be best then with the trigger operating the hide/unhide. Of course you need switch scripting then, which can be taken from the TOW maps easily. I also think JV's wait line is a good idea depending on the situation...in an MP map you could have sheer mayhem with this system. 
Darn
Ok i'll let u into what im playing with
Basicly when i'm at work - I get bored my mind wonders and I think about what I can try mapping, anyway I was thinking it would be cool to be able to parachute into the map basicly the reason i want the hide/unhide is after you've parachuted in you walk past the trigger and your chute is behind you (but i donw want it to be seen as you drop in.
Only the dam thing (mockup of chute - looks nothing like one) is visible when u spawn aghhhh heres my script
Basicly when i'm at work - I get bored my mind wonders and I think about what I can try mapping, anyway I was thinking it would be cool to be able to parachute into the map basicly the reason i want the hide/unhide is after you've parachuted in you walk past the trigger and your chute is behind you (but i donw want it to be seen as you drop in.
Only the dam thing (mockup of chute - looks nothing like one) is visible when u spawn aghhhh heres my script
Code: Select all
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none" //your score board picture
level waittill prespawn
exec global/DMprecache.scr
level.script = "para_test.scr" // remember to put in your map name
level waittill spawn
$theobject hide
thread show_setup
end
show_setup:
$thetrigger waittill trigger
$theobject show
thread hide_setup
end
hide_setup:
$thetrigger waittill trigger
$theobject hide
thread show_setup
end .MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
Well, if you want to use a switch to toggle the object visibilty, then check out this modified version of my lightswitch tutorial. Yes it uses the thread command, but it works 100%. So no refining by jv is needed this time.
1. Create a switch by selecting animate_equipment_electric>>switch>>nopulse
2. Give the switch a targetname of object_switch
3. Create a trigger_use around the switch and give it a targetname of switch_trigger
4. Now create the object that you want to show/hide and give it a targetname of theobject
5. Enter the following script after level waittill spawn in your .scr file :
$theobject hide
thread object_show
end
object_show:
$switch_trigger triggerable
$switch_trigger waittill trigger
$switch_trigger nottriggerable
$object_switch anim turn
$object_switch playsound alarm_switch
wait .25
$theobject show
wait .5
thread object_hide
end
object_hide:
$switch_trigger triggerable
$switch_trigger waittill trigger
$switch_trigger nottriggerable
$object_switch anim off
$object_switch playsound alarm_switch
wait .25
$theobject hide
wait .5
thread object_show
end
Its as simple as that. Taken directly from my lightswitch tutorial.
1. Create a switch by selecting animate_equipment_electric>>switch>>nopulse
2. Give the switch a targetname of object_switch
3. Create a trigger_use around the switch and give it a targetname of switch_trigger
4. Now create the object that you want to show/hide and give it a targetname of theobject
5. Enter the following script after level waittill spawn in your .scr file :
$theobject hide
thread object_show
end
object_show:
$switch_trigger triggerable
$switch_trigger waittill trigger
$switch_trigger nottriggerable
$object_switch anim turn
$object_switch playsound alarm_switch
wait .25
$theobject show
wait .5
thread object_hide
end
object_hide:
$switch_trigger triggerable
$switch_trigger waittill trigger
$switch_trigger nottriggerable
$object_switch anim off
$object_switch playsound alarm_switch
wait .25
$theobject hide
wait .5
thread object_show
end
Its as simple as that. Taken directly from my lightswitch tutorial.
K thx ill try that
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
I know why it wasnt working before - for some reason the trigger keeps dissapearing i put it in the map save reopen it and its gone wot the hell is goin on there
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
