Building & Scripting > Scripting Board
Object Script syntax for object entering rooms
(1/1)
erwin:
Hi all,
I'm not very sure about the different types of Object scripts, so here's an example of what I would like to happen.
I'm looking for a trigger to put on an object carried by a player. When the player enters the room, the object will check the vnum of the room. If the vnum is a certain number, then something happens.
I'm guessing this is ObjEnter type of trigger, but I'm not sure what the syntax is.
Help given would be appreciated. Thanks!
Calypso:
My guess that it would be easier to add the script to the room to check for the object.
Molly:
I like the idea, but given the number of rooms we already have in the mud, it would be a next to impossible task to add it to all those.
Also the script would be so long and hard to overlook that it really isn't feasible.
Now if the script was set on an object, let's say a Room Counter Gadget, we could make a gadget like that for each zone that we want to add the room counter feature to. (Or maybe we could set the script to the zone's Questcard, almost every zone has that).
Once we have a working script, it could easily be copied to new vnums.
This would be a feasible way to add it to one zone at the time.
It would be up to the Builder to provide a list of which rooms in their zone that are:
1. accessible
2. unaccessible for mortals
3. unused.
One problem, that Erwin pointed out, is that at present there is no ENTER flag for objects. We need one to be added to the DG-script code, which means a Coder effort.
Also we need to make sure that this ENTER flag works both if the player walks into the room or is teleported there.
That said, I really like the idea, it could be very useful, especially for zones with mazes and hidden parts. Not all zones would need a room counter.
Xeriuth:
You could have it simply be the flag goes off when entering the room if a certain object is worn by the actor entering. I don't have any code in front of me, but I believe you can set a room flag to trigger upon entry and that the overlying if statement would be determined if an item is worn by the user. Objects themselves I don't think have an enter flag because they dont necessarily walk, I could look into coding in when an object passes into a certain room, but do distinguish the room you'd still have to reference it or apply it to the room in some way so it begins to seem possibly redundant to me. I will test this sometime and see if I can get it to work like you want.
Navigation
[0] Message Index
Go to full version