 |
crimson150 Beginner
Joined: 19 Jun 2004 Posts: 13 Location: USA
|
Posted: Thu Nov 30, 2017 7:20 am
Help with Combat Script |
Have recently been in trouble for kill stealing mobs on the mud I am playing. The other plays do not need to actively be engaged in battle, but just in the room with the mob. Is there a way to setup my script to check to see if there is another player in the room before attacking a mob?
|
|
_________________ "This is your world, these are your people, you can live for yourself today, or help build tomarrow for everyone. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4749 Location: Pensacola, FL, USA
|
Posted: Thu Nov 30, 2017 11:25 am |
There should be, yes.
you would need to capture all the living things in the room, mob or otherwise, and then compare it against a known list of character names. |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
crimson150 Beginner
Joined: 19 Jun 2004 Posts: 13 Location: USA
|
Posted: Sat Dec 02, 2017 5:32 am |
Any way to show me how to do something like that?
|
|
_________________ "This is your world, these are your people, you can live for yourself today, or help build tomarrow for everyone. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4749 Location: Pensacola, FL, USA
|
Posted: Sat Dec 02, 2017 6:49 am |
Give me an example of some MUD output to go off of?
|
|
_________________ Discord: Shalimarwildcat |
|
|
 |
crimson150 Beginner
Joined: 19 Jun 2004 Posts: 13 Location: USA
|
Posted: Sat Dec 02, 2017 10:20 am |
Lair of Evil Pleasures
This room is garishly plush. Thick red carpets cover the floor and
draperies of the same hang and billow on the walls. Between the
hangings are lovely marble statues, but as you look closer, the statues
depict men and women in unspeakable acts. There are implements of
torture laying on the rugs and hanging on the wall, equipment meant to
break the person's will and spirit, while leaving the body intact for
evil purposes.
[ Exits: n ]
The corpse of Evil Pleasure is laying here.
Frs [RaceCar] is here, fighting Evil Pleasure!
Evil Pleasure is here, fighting Frs!
An Evil Pleasure of the mind is standing here. |
|
_________________ "This is your world, these are your people, you can live for yourself today, or help build tomarrow for everyone. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4749 Location: Pensacola, FL, USA
|
Posted: Sat Dec 02, 2017 6:11 pm |
#TR {, fighting (*)!} {#CW firebrick;#IF (%ismember(%1, @playerNames)) {#BEEP;#SAY {This room is taken}}}
Something like that will highlight ongoing fights.
Not sure if that alone would be enough to indicate another player.
If not, you would have to populate the @playerNames variable yourself. |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
crimson150 Beginner
Joined: 19 Jun 2004 Posts: 13 Location: USA
|
Posted: Sat Dec 02, 2017 6:29 pm |
I would actually be okay with populating the player list myself, I just need to ensure when i enter a room that looks like this one, or the one above that it flips my battle folder off so it doesn't start combat.
Shrine of Cumae
This rocky citadel had been colonized by Chalcidians from Euboea. One
side of it had been hollowed out to form a vast cavern into which led
a hundred broad shafts, a hundred mouths, from which streamed as many
voices giving the responses of the Sibyl. The exit is to the east.
[ Exits: e ]
Frs [RaceCar] is standing here.
...Frs glows with a bright light!
Sibyl is standing here.
...Sibyl glows with a bright light! |
|
_________________ "This is your world, these are your people, you can live for yourself today, or help build tomarrow for everyone. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4749 Location: Pensacola, FL, USA
|
Posted: Sat Dec 02, 2017 7:16 pm |
Code: |
#TR {is standing here.} {
$name=%word(%line, 1)
#IF (%ismember($name, @playerNames)) {
#BEEP
#SAYADD { - <color aqua>Keep Moving!</colord>}
}
} |
this will toggle on and off, respectively.
#T+ BattleFolder
#T- BattleFolder |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
crimson150 Beginner
Joined: 19 Jun 2004 Posts: 13 Location: USA
|
Posted: Sun Dec 03, 2017 6:10 am |
is there a way to reverse this, so that it only needs to check for a list of only my characters? for instance if it sees anyone in the room NOT on the list, it shuts down, instead of only shutting down if it sees people ON the list, I am not very familiar with using %Ismember command since this is my first time, is there such a thing as %Isntmember?
|
|
_________________ "This is your world, these are your people, you can live for yourself today, or help build tomarrow for everyone. |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4749 Location: Pensacola, FL, USA
|
Posted: Sun Dec 03, 2017 8:23 am |
just use:
#IF (!%ismember($name, @list)) {dostuff}
the ! acts as the not in an expression |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
|
|