Teleport Certain Players in Room (Object) [Request]

More
6 years 3 months ago #5363 by Kay
Could I get some help please.

Interested in having an trigger/item(which must be held) that when used will teleport every single player of a certain race in the room to another room. Once it has done this the item will then destroy(purge) itself.

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

More
6 years 3 months ago #5365 by Parnassus
You've asked something that seems really complicated to me and I don't know your level of experience so some of what I say will seem too easy and some will seem too hard, probably.

Choose what will trigger the action:
help obj-trig-types

From there, check the trigger type to see if held can be specified, such as:
help trigedit-obj-command

Then you need to create a loop to check each player in the room for the characteristic you're looking for. I usually use the decapitating rabbit trigger for this:
tstat 1398 (Random Rabbit Decapitates Mobs - M1307)
However, this is really dealing with mobs, not players. You may prefer this one:
tstat 24 (Room While Teleport Example)

Next: Basic TBA does not have races so there isn't a way to check that. If your mud has implemented races, check to see if they've also implemented a way to check.
help char-var
help race
Insert your check into the loop so your trigger only affects the ones that meet your criteria.

Finally, the purge. The rabbit purges itself so there's an example. Also read:
help %purge%
Remember that when you purge the object that has the trigger, you need to have the purge at the end because any following commands can't be done when the trigger no longer exists.


I hope this info helps you.

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

More
6 years 3 months ago - 6 years 3 months ago #5367 by Kay

You've asked something that seems really complicated to me and I don't know your level of experience so some of what I say will seem too easy and some will seem too hard, probably.

I hope this info helps you.



The basic(very basic one, mind you) are ones based on examples. The major issue I'm having is that I can't find any examples of loops that are activated with commands



Does not activate at all

and is based more or less on the examples you gave plus this example on the forums

* a small script to make a bomb go off three seconds after it's dropped.
set room_var %actor.room%
* Send a message when the bomb goes off.
wait 3 s
%echo% The Grenade blasts into smithereens, striking everyone here.
* Target the first char
set target_char %room_var.people%
* Do stuff
while %target_char%
* Set the next target before this one perhaps dies.
set tmp_target %target_char.next_in_room%
* This is where the good/bad things are supposed to happen.
%send% %target_char% The explosion hurts you.
%damage% %target_char% 30
* Find next target
set target_char %tmp_target%
* Loop back
done



the trigger was made to target males and not a specific race. Hopefully means I can get help
Last edit: 6 years 3 months ago by Kay.

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

More
6 years 3 months ago #5370 by thomas
what does the "top" of the trigger say?
The arguments matter.

tstat 102 or 131 functioning triggers that listens for commands.

About the the (%target.sex% == Male) -check. The %actor.sex% returns either male, female or neutral. The case matters in == checks.

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

More
6 years 3 months ago - 6 years 3 months ago #5373 by Kay

what does the "top" of the trigger say?
The arguments matter.

tstat 102 or 131 functioning triggers that listens for commands.

About the the (%target.sex% == Male) -check. The %actor.sex% returns either male, female or neutral. The case matters in == checks.


male case changed, thanks for that. Won't forget.

Last edit: 6 years 3 months ago by Kay.

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

More
6 years 3 months ago #5376 by Parnassus
You missed this step:

From there, check the trigger type to see if held can be specified, such as:
help trigedit-obj-command


Numeric Arg : a bitfield to indicate where the object must be in order to cause the trigger to activate.
Bits:
1: In character's worn equipment.
2: In character's carried inventory.
4: In same room with the character.

These bits can be set at once by adding the values.
7= worn, inv, room. 3 = worn, inv. 5 = worn, room.

You've pretty much told it that the object can't be carried, worn or in the same room.
The following user(s) said Thank You: Kay

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

More
6 years 3 months ago #5381 by Kay

You missed this step:

You've pretty much told it that the object can't be carried, worn or in the same room.





Strugglign to see the issue with where to get/make the targets.

Response to that trigger is:

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

More
6 years 3 months ago #5383 by Kyle
how important is it to you that this be done with a trigger?

i'm willing to help out by maybe writing a SPECIAL for this, but as of about 6 years ago I absolutely refuse to work with DG scripts

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

More
6 years 3 months ago #5385 by thomas
hmm.. you're mixing %target% and %target_char% there.
The if-check is always false, so you and the presumable other person in the room see the result of

%send% %target% The bright light...

which fails and logs twice (once for you and once for the other) about it.

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

More
6 years 3 months ago - 6 years 3 months ago #5389 by Kay

how important is it to you that this be done with a trigger?

i'm willing to help out by maybe writing a SPECIAL for this, but as of about 6 years ago I absolutely refuse to work with DG scripts


Not sure what you mean by special. Could you please explain to me what that is? The item isn't going to be on TBA so if it's something that HAS to be done MUD/Code side then I'm not sure I could get the Imp on my MUD to put it in.

hmm.. you're mixing %target% and %target_char% there.
The if-check is always false, so you and the presumable other person in the room see the result of

%send% %target% The bright light...

which fails and logs twice (once for you and once for the other) about it.


So the part with:

%send% %target_char%

should be

%send% %target%
Last edit: 6 years 3 months ago by Kay. Reason: mutiple quotes

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

More
6 years 3 months ago #5390 by thomas
Either settle on target_char or target.

That means switching

if (%target.sex% == male)

with

if (%target_char.sex% == male)

and the change to the %send% you mentioned.
The following user(s) said Thank You: Kay

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

More
6 years 3 months ago #5393 by Parnassus
It's really a good thing that Thomas can look at these things and see the problems because I'm gonna admit here, I have to do tests to try to figure out what goes on with the insides of triggers. To do that with yours, since you link to images of your trigger, I'd have to type it all out manually. If you copy and paste into a code window (that one up there that looks like a page with <> on it) any of us that might want to run tests can just copy and paste it out of the window.

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

More
6 years 3 months ago #5400 by Krell
I'm probably asking the painfully obvious, but have you tried the command with a character that's not an Imm? Either temporarily set your Imp to a much lower, mortal level or use a test mortal to verify if your command trigger is working.

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

More
6 years 3 months ago #5403 by Parnassus
I wondered that too, since I think that's the message I see when I accidentally have no-hassle on. I don't really have the time to type it all in manually to play with it.

I'm glad you mentioned that though because if Kay still gets messages after doing Thomas' fix, it may seem as if the fix didn't work.

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

More
6 years 3 months ago #5404 by Kay


The solution works and the object is working as I envisioned it. I am extremely grateful for all the help that I've recieved guys.

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

Time to create page: 0.165 seconds