Forum > Serverside Modding

[QUESTION] Opening/Closing door system

(1/2) > >>

Zorak:
Hi there,

I would like to ask, if someone has some experience with creating door system. I saw (on another server) doors, which were able to just open on one click, and on second click close itself, no matter who clicked on them (one player opens it, another closes).

I tried to go through the code, but even if I am able to understand the code in general, I am not able edit it.
Now, there is a timer, which closes the door in time (which is load from object's record in DB).
After the timer comes to zero, it resets the door (closes).

Maybe, I would be able to edit it myself, but I cannot find any click function.

now it is something like

case GO_activated (but it says only IS activated, not HOW)
> if door with the right activate state
>set timer
>reset door

but I need something like

if activated
onclick deactivate
if deactivated
onclick activated



So, is here somebody, who is willing to help me?

I am uploading the source file now. If you go CTRL+F "door" (od "DOOR" if your editor need exact letter), you will find any functions attacched to this problem.



Thanks a lot :)

[attachment=0:1s0flh33]GameObject.cpp[/attachment:1s0flh33]

stoneharry:
Generally the gameobjects that are flagged to open and close on click are client side. So other players won't see the change when you open the door.

What you could do is listen for the event firing on gameobject activate, then see if what the current gameobject bytes are set to. If bytes are set to open, close the object, else open.

*shrug* On which gameobject type the event fires and whether it produces the desirable effects will require testing.

Ascathos:
Orientate around the instancescripts regarding doors, maybe it helps.

schlumpf:
Shadow labyrinth door is not character specific iirc.

iindigo:

--- Quote from: "schlumpf" ---Shadow labyrinth door is not character specific iirc.
--- End quote ---
Neither is the door in front of the PvP place in Stormwind’s Old Town. During the zombie invasion, zombies were the only one that could click on it, so when they closed the door they locked everybody who wasn’t a zombie out. It made for a lot of angry players who couldn’t get in to buy their BG and arena gear.

EDIT: wouldn’t BG gates also qualify as non-character-specifc doors?

Navigation

[0] Message Index

[#] Next page

Go to full version