Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
crimson150
Beginner


Joined: 19 Jun 2004
Posts: 13
Location: USA

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
crimson150
Beginner


Joined: 19 Jun 2004
Posts: 13
Location: USA

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Dec 02, 2017 6:49 am   
 
Give me an example of some MUD output to go off of?
_________________
Discord: Shalimarwildcat
Reply with quote
crimson150
Beginner


Joined: 19 Jun 2004
Posts: 13
Location: USA

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
crimson150
Beginner


Joined: 19 Jun 2004
Posts: 13
Location: USA

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
crimson150
Beginner


Joined: 19 Jun 2004
Posts: 13
Location: USA

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Dec 03, 2017 8:23 am   
 
just use:
#IF (!%ismember($name, @list)) {dostuff}
the ! acts as the not in an expression
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net