Door scripting problem


(Donpedro) #1

Hi again
I created a door what is moveable by pressing a button. It works really good, i have ony small problem. If i press the button, the door start opening. While the door is opening and then i press the button, the button is moving, but the door don’t start to close. Did you understand me? Not? Here are the files:
www.et-section.atw.hu/maps.zip


(kamikazee) #2

So, you want a button which opens the door if you press it, and close it if you press it again without waiting for the door to open completely?

I would try to put a “halt” statement before the “resetscript” statements in both of your door script blocks.

I can’t check right now if that is the problem, maybe someone else will in the mean time.


(Donpedro) #3

Halt? Do you think wait xy?


(murka) #4

but do you want a door that can be interrupted while its moving or you want the lever not to move while the doors are closing/opening?
but first, why are you using globalaccums?


(kamikazee) #5

No, “halt”. It stops an entity when it’s moving.


(Donpedro) #6

I want the first (door that can be interrupted while its moving). I dunno waht is the real difference between globalaccums and accums


(murka) #7

yeah then use “halt”
the difference is that globalaccums can be used throughout the script.
accums are used only in their scriptname.


(kamikazee) #8

Correct.
Now you might think what the difference is, but consider this:
-you used up 8 globalaccums because you have 2 buttons, 4 door-parts and 2 parts to make a drawbridge.
-you want to add a tank but you haven’t got any place to store the position/status
-now you 'd need to go back and rethink the whole script.

Moral: try to stick to accums when you don’t need those values anywhere outside that entities script block, which is the case here.


(Donpedro) #9

o.O I’m confused, but “normal” accums doesnt fix my problem


(Darkfrost) #10

Is it just me or are the tapirs taking over our sigs? :slight_smile:

:stroggtapir:


(murka) #11

nah its only you


(Donpedro) #12

Figured it out, just needed to put a wait thend gotomarker like here

gotomraker xy 32 [b]wait[/b]