Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Mob progs and entry issue?
Mob progs and entry issue?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Gatewaysysop2
USA (146 posts) Bio
|
Date
| Mon 03 Mar 2003 08:20 PM (UTC) |
Message
| Hey everyone,
What I'm trying to do right now is put together an entry_prog that will cause my mob to react to people when the mob itself enters a room. I've got a greet program that works fine when someone else walks in, that's not the issue at all. My problem is that I can't seem to get the mob to react properly when people come in.
For example. I want to do a very simple ifcheck such as
if isevil($n)
and isnpc($n)
or is<blah>($n)
etc etc...
murder $n
endif
This works fine for the greet_prog but not the entry_prog. I read somewhere that the entry trigger requires you to use $r so I tried that, but it doesn't work either. I guess you probably see what I'm trying to do with this? I basically want the mob to kill anything that fits a certain demographic when either a) he goes into a room or b) they come into the room where he's already at. I've gotten part B to work out fine. It's only the entry half of it that gives me grief.
Does anyone have suggestions on how to make an ifcheck like this work, or some way to facilitate what I'm trying to do? I'd like it to do this with both NPC's and, say, pkillers for now. Like I said I can program this just fine for a greet_prog and it works like a charm but obviously the same won't work for entry_progs an I need to know how I should change it.
Any help is greatly appreciated!
|
"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 04 Mar 2003 02:29 AM (UTC) |
Message
| Where did you put the $r? This is what the help file says ...
Syntax: entry_prog <NUMBER>
Again a percentage argument.
NOTE: The opposite of a greet_prog. Whenver the mobile itself enters a new
room, this can be triggered. Useful for looking around, or waving
or other things that real PCs do when they arrive at a crowded room.
Only the first successful one of these is done so the mobile doesnt
look stupid by repeating commands resulting from multiple MOBprograms.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Gatewaysysop2
USA (146 posts) Bio
|
Date
| Reply #2 on Tue 04 Mar 2003 07:30 AM (UTC) |
Message
| Sigh...
Here we go again. Yes I read the manual. I read the helpfiles, I went to websites. That's where I got the notion that you can't use $n with the ifchecks in the entry_prog at or at least not the first one[s], because it needs to be a random person/actor in the room since no one person $n triggered it.
I did a simple entry_prog 100 that went something like this;
if isevil($r)
murder $r
endif
This won't work. I've tried copying my exact greet program into an entry program:
if isevil($n)
and isnpc($n)
or ispkill($n)
say Death to thee $n!
murder $n
endif
I swap out the $n's with $r's and nothing changes, still doesn't work when used as an entry prog. So what am I doing wrong? How do I go about getting my mobs to randomly target someone with this entry program and execute whatever kinds of commands (in this case killing them)? |
"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence | Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #3 on Tue 04 Mar 2003 08:43 PM (UTC) |
Message
| For starters, if the examples you gave are anything close to what youre attempting to test on your mud there are several very definate issues to address.
1) The entry triggers check for evil npc or pkill targets.
2) If yer trying to test with an immortal character (and I suspect you are) the mprog engine is designed NOT to trigger any violence on immortals.
3) If you arent testing voilence triggers be certain you aren't wizinvis or the mob wont see you to react to you.
4) It has been my experience that using entry progs to initiate combat is **at best** difficult. More often than not, using entry progs to initiate combat is more trouble than its worth when simply slaping an aggo flag on the mob will acomplish the same results. If you absolutely have to have the mob react to a specific set of chars with violence, make it stationary and use a grall prog. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Gatewaysysop2
USA (146 posts) Bio
|
Date
| Reply #4 on Tue 04 Mar 2003 09:46 PM (UTC) |
Message
| I tested this countless ways, as I did the other one. I had the mob enter with me in the room. I had the mob enter with another player in the room of any particular level, pkill or otherwise. I even tried stripping the requirements and just having it kill SOMEONE, ANYONE at random when it entered. Nothing happened. I tried having other mobs wait in the room, made sure to 'switch' into my killer mob and make sure he could 'see' these people waiting there when he walked in. The mob is entering the room, seeing the people, but this entry_prog will never trigger.
As a side note, the greet_prog I have, which does work, strangely enough *will* attack me when I go into the room with the mob, as long as I'm not invis or something. But I never banked on the results of testing with an imm character anyway. Like I said I tried using regular players and other mobs in plain sight as bait for the trigger when I had this mob walk into the room. The targets are there, and the mob can see them, but when the mob enters the room his entry_prog never triggers and he never attacks anyone.
I'd love to just use an aggressive flag on the mob, which I did with another similar character, but I want **this** particular wandering mobile to be picky about who he's aggressive towards when he strolls into a room. That's the whole motivation for this. I also want to be able to get it to be aggressive against others mobs in the same way my earlier specified greet program is, which an agg. flag won't accomplish.
Does this make sense? Any other suggestions?
|
"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence | Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #5 on Wed 05 Mar 2003 05:50 AM (UTC) |
Message
| Suggestions? Write a spec function. All the function with none of the finickyness. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Wed 05 Mar 2003 10:52 PM (UTC) |
Message
| Run under gdb, set a breakpoint at mprog_entry_trigger and then trace mprog_driver to see what it thinks it is doing. The code is complex enough that it is hard to see what might be wrong.
Alternatively, put in some judicious printfs to see how far through the code it gets. eg. in mprog_entry_trigger, in mprog_driver near the start, and so on. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
18,089 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top