Author Topic: Object Script syntax for object entering rooms  (Read 9817 times)

0 Members and 2 Guests are viewing this topic.

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Object Script syntax for object entering rooms
« on: June 04, 2013, 06:45:42 pm »
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!

Offline Calypso

  • Administrator
  • Full Member
  • *****
  • Posts: 133
    • View Profile
    • Email
Re: Object Script syntax for object entering rooms
« Reply #1 on: June 05, 2013, 05:48:31 pm »
My guess that it would be easier to add the script to the room to check for the object.
« Last Edit: June 05, 2013, 05:51:43 pm by Calypso »
I get my energy from my Inner G.

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: Object Script syntax for object entering rooms
« Reply #2 on: June 06, 2013, 02:26:08 am »
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.

Offline Xeriuth

  • Global Moderator
  • Full Member
  • *****
  • Posts: 241
  • Coder
    • View Profile
Re: Object Script syntax for object entering rooms
« Reply #3 on: October 28, 2013, 11:30:59 am »
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.
Snazzy Signature Block Goes Here