If Checks on PC Speed

For builders to discuss and ask building questions.
Post Reply
Arnof
Sword Journeyman
Sword Journeyman
Posts: 129
Joined: Wed Oct 22, 2008 8:47 pm
Location: Arizona, USA
Contact:

If Checks on PC Speed

Post by Arnof » Sun Jan 14, 2018 9:15 pm

So, I'm looking to have a different echo if a PC is flying/soaring over water vs swimming. Is there a:

Code: Select all

if speed(n$) == swim
or

Code: Select all

if position(n$) == swimming
sort of thing? Is swimming/flying a position in the eyes of the MUD?

I do not see what I'm hoping for in Mobile Positions or an ifCheck for speed in the If Check Lessons

Thanks in advance,
B
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: If Checks on PC Speed

Post by Harroghty » Sun Jan 14, 2018 9:31 pm

That seems reasonable, but I've never seen it before. I tested and while speed is a value (with text and numerical options) in FKBIT it is not a valid check. There is an affect for flying (if isaffected($n) == flying), but not one for swimming.

Meanwhile, what are you trying to do?
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Arnof
Sword Journeyman
Sword Journeyman
Posts: 129
Joined: Wed Oct 22, 2008 8:47 pm
Location: Arizona, USA
Contact:

Re: If Checks on PC Speed

Post by Arnof » Sun Jan 14, 2018 10:16 pm

In this area - Immurk's Hold - there's a large harbor and based on lore it not only has giant ships, it very likely has massive sharks and maybe sea serpents. So, while I hadn't planned on writing MOBs for this purpose I did want a general echo to give the impression. This is essentially what I came up with with help.

Code: Select all

>greet_prog 20~
if isaffected($n) == fly
	mpechoat $n You become all too aware that lore might just be true and massive sea creatures gather just below the surface of the water.
else
	if ismounted($n)
		mpechoat $n You become all too aware that lore might just be true and massive sea creatures gather just below the surface of the water.
	else
		mpechoat $n You feel something brush up along your side as you swim.
	endif
endif
~
|
The thought there is 1) Are they flying? Cool. 2) Are they mounted and over water? Means they're on a flying mount. Cool. 3) Not doing 1. or 2.? Alright, you're swimming.

Am I on the right path there?
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: If Checks on PC Speed

Post by Harroghty » Sun Jan 14, 2018 10:32 pm

Yes, but check:

Code: Select all

if isaffected($n) == Flying
or isaffected($n) == Levitate
What happens if they are swimming? Just an echo? That would get annoying maybe.

I might make the echo on a random percentage basis. e.g.

Code: Select all

if rand(33)
  mpechoat $n Whatever, it's scary...
else
  if rand(50)
    mpechoat $n Yep, scary
  else
    mpechoat $n You see a monster!
    mpechoaround $n A monster emerges from the deep to attack @N!
    mpmload 1234
    mpforce m1234 mpkill $n
  endif
endif
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Post Reply