Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: sgray97 on June 11, 2014, 10:12:44 pm
Title: automatic door script advice
Post by: sgray97 on June 11, 2014, 10:12:44 pm
i just set up a basic door movement script and have a some questions about how to make it truly "automatic" like for example if a player is in the radius of the trigger the movement will occur.
this is one of my first few scripts and i would like some advice to improve my scripting any help will be appreciated and credit given
Title: Re: automatic door script advice
Post by: daedra descent on June 11, 2014, 10:18:37 pm
I don't see anyway to really improve it besides using getentarray() so you can have more than one "automatic" door. For what your trying to do in your code you can't simplify it any.
But you don't need
the "user" in this unless you need to specify who is triggering the entity.
Title: Re: automatic door script advice
Post by: DidUknowiPwn on June 11, 2014, 10:41:45 pm
Make it a while or a for loop (while( true ) preferably) and check if the door is moving if it is pull it back again so player doesn't have to wait (unless you want to). Currently you're only making it only run once.
Title: Re: automatic door script advice
Post by: daedra descent on June 11, 2014, 10:45:49 pm
Make it a while or a for loop (while( true ) preferably) and check if the door is moving if it is pull it back again so player doesn't have to wait (unless you want to). Currently you're only making it only run once.
It is looping. He just didn't use a while() or for() loop on it.
Calling the same function within itself will loop it.
Title: Re: automatic door script advice
Post by: sgray97 on June 11, 2014, 10:50:37 pm
i wanted to have the doors open without having to use F key to open it maybe use a trigger_radius would that do that?
Title: Re: automatic door script advice
Post by: daedra descent on June 11, 2014, 10:51:43 pm
i wanted to have the doors open without having to use F key to open it maybe use a trigger_radius would that do that?
I don't know about trigger radius's, but i know a trigger_multiple will work for that.
Title: Re: automatic door script advice
Post by: sgray97 on June 11, 2014, 10:53:31 pm
alright thanks ill try that is there a way to reduce the stock radius of the trigger maybe use KvP "radius" "#"
Title: Re: automatic door script advice
Post by: PROxFTW on June 11, 2014, 10:56:40 pm
Quick script I made waiting to dl something. Simply what it does it checks if a player is in a certain distance then opens the door. Hasn't been tested so if any errors just let me know.
Title: Re: automatic door script advice
Post by: daedra descent on June 11, 2014, 10:57:24 pm
The trigger is activated when a player touches it. Simply resize the trigger until you have it where you want for the radius.
Title: Re: automatic door script advice
Post by: steviewonder87 on June 11, 2014, 11:09:10 pm
But what about zombies? Do they trigger it too, otherwise they're gonna spawn in the adjacent/current zone and just pile up on the other side of the door if the player is standing on the other side..
Title: Re: automatic door script advice
Post by: sgray97 on June 11, 2014, 11:28:02 pm
i was thinking about a way to do that but i guess i might have to just give them a path around the doors through barriers or something but quick question how would i make the doors open faster then the slow opening of the doors?
Title: Re: automatic door script advice
Post by: daedra descent on June 11, 2014, 11:40:06 pm
i was thinking about a way to do that but i guess i might have to just give them a path around the doors through barriers or something but quick question how would i make the doors open faster then the slow opening of the doors?