Welcome to the Builder Academy

Question [Request] Activate Room trigger with specific OBJ

More
29 Sep 2016 01:46 - 29 Sep 2016 01:49 #6181 by Kay
Yeah, so I'm trying to understand(get help) with why my trigger isn't working as intended. I want it so that if a character has a certain item(in INV) and they used a command then it will trigger. I've looked up the different variables on the DG site and none seem to work. Could I please get help(and an explanation)?

Name: 'Sun Stone/Dial Trigger', VNum: [63500], RNum: [ 242]
Trigger Intended Assignment: Rooms
Trigger Type: Command , Numeric Arg: 100, Arg list: reflect




Here is my first attempt at the trigger.
Code:
if (%cmd% == reflect) if (%arg% == stone) if (%object.vnum% == 63502) wait 1 s %teleport% %actor% 63541 %send% %actor% The trigger successfully works! end end end
When you get to the if obj.vnum part it doesn't work. The first two IFs work but the last(third) one doesn't

Second variation of the trigger

Code:
if (%cmd% == reflect) if (%arg% == stone) if (%char.inventory(63502)%) wait 1 s %teleport% %actor% 63541 %send% %actor% The trigger successfully works! end end end

And then I found something interesting/odd
Code:
if (%cmd% == reflect) if (%arg% == stone) if (%object.vnum% != 63502) wait 1 s %teleport% %actor% 63541 %send% %actor% The trigger successfully works! end end end

The trigger actually fires and works(I am teleported) but this works if you have the item(63502) in your INV or even if you don't have it. So it's not what I want but it only confuses me more since I would expect it to not work if you have the item in your INV( due to being "!="); so I'd also really like help with understading the difference between "==" "!=".
My understanding
== : You need that EXACT level/item/mob/etc to work
!= : You need anything BUT that level/item/mob/etc
Last edit: 29 Sep 2016 01:49 by Kay. Reason: [/code] added in

Please Log in or Create an account to join the conversation.

More
29 Sep 2016 19:06 #6183 by thomas
Try this:
Code:
if (%cmd% == reflect) if (%arg% == stone) if (%actor.inventory(63502)%) wait 1 s %teleport% %actor% 63541 %send% %actor% The trigger successfully works! end end end

Note that it's almost the same as the second try - we just look up on the character actually performing the action (the %actor% variable).
%char% in the examples just means "substitute char with the name of your variable, be it actor, victim or foo".
The following user(s) said Thank You: Kay

Please Log in or Create an account to join the conversation.

More
29 Sep 2016 23:47 #6186 by Kay

thomas wrote: Try this:


Note that it's almost the same as the second try - we just look up on the character actually performing the action (the %actor% variable).
%char% in the examples just means "substitute char with the name of your variable, be it actor, victim or foo".


Thank you very much. I always assumed that %char% was for the PC(player character)

Trigger is working perfectly now

Please Log in or Create an account to join the conversation.

Time to create page: 0.275 seconds