Idea : Horse dismount tracking script

... A place to ask for help on any topic whether it be starting out to player killing to IT issues.
Tran
Posts: 84
Joined: Sat Apr 30, 2016 1:49 pm

Re: Idea : Horse dismount tracking script

Post by Tran » Thu Aug 25, 2016 9:35 pm

I'm home! And installing it now and testing it out.

galfrey
Posts: 80
Joined: Mon Aug 10, 2015 5:28 pm

Re: Idea : Horse dismount tracking script

Post by galfrey » Thu Aug 25, 2016 9:57 pm

would it be possible for it to do it when you lose the horse after leading it too? i tried it out of curiosity and it works really well at the moment but would be good if it unhighlighted after lead and rehighlighted and recorded spams if the horse is lost while following you (for tunnels etc)

I dont have a clue how to do any of this at all so it was just a though, if its not possible im sure the people who use it will be fine with that was simply curious

Tran
Posts: 84
Joined: Sat Apr 30, 2016 1:49 pm

Re: Idea : Horse dismount tracking script

Post by Tran » Thu Aug 25, 2016 10:03 pm

Ok, first impressions :

I did most of my tests slowly.

Horseloc works great even while horse hoping.

Gotohorse also works great even while horse hoping.

Forgethorse works to reset the color of the map IF you don't horse hop. It will change the Map room Color everytime you dismount any horse.

So far I've found that if you ride a horse, go to room X, dism, move 1n, ride a new horse and dism immediately. Both your room and 1s of you will be green on the map. OH! I think it's because I was messing with colts, black stallions and a prancing pony. Some respond to Him and others to Her.

IE :

You start riding him.
You start riding her.

Also after a bit more time of testing and messing around.

- Gotohorse : Does not take norides into consideration.

(Minor detail seeing as there aren't all that many no rides to begin with AND I should be dism if ever I use Gotohorse in the first place!)

- Horseloc, Gotohorse and the Mapcolorchange all have the tiniest lag that means that if I am spamming hard to point B from point A and dism half way through, the "Marker" will be 4-5 rooms off from the room I dismounted at.

(Minor detail seeing as the Map color marker should still give me a pretty good idea of where the horse is as opposed to no idea at all.)

The main problem I am seeing so far is that my Map is becoming covered in little Green squares from the dismount triggers. I am not sure if that's due to dismounting and remounting too quickly or because of the male and female horses or what exactly. Is there a way to forgetallhorses? Or something of the like..?

I will test more things out in the near future, but for tonight I don't have enough time unfortunately.

byrg
Posts: 394
Joined: Fri Aug 07, 2015 8:56 pm

Re: Idea : Horse dismount tracking script

Post by byrg » Thu Aug 25, 2016 10:55 pm

Tran wrote:Ok, first impressions :

I did most of my tests slowly.

Horseloc works great even while horse hoping.

Gotohorse also works great even while horse hoping.

Forgethorse works to reset the color of the map IF you don't horse hop. It will change the Map room Color everytime you dismount any horse.

So far I've found that if you ride a horse, go to room X, dism, move 1n, ride a new horse and dism immediately. Both your room and 1s of you will be green on the map. OH! I think it's because I was messing with colts, black stallions and a prancing pony. Some respond to Him and others to Her.

IE :

You start riding him.
You start riding her.

Also after a bit more time of testing and messing around.

- Gotohorse : Does not take norides into consideration.

(Minor detail seeing as there aren't all that many no rides to begin with AND I should be dism if ever I use Gotohorse in the first place!)

- Horseloc, Gotohorse and the Mapcolorchange all have the tiniest lag that means that if I am spamming hard to point B from point A and dism half way through, the "Marker" will be 4-5 rooms off from the room I dismounted at.

(Minor detail seeing as the Map color marker should still give me a pretty good idea of where the horse is as opposed to no idea at all.)

The main problem I am seeing so far is that my Map is becoming covered in little Green squares from the dismount triggers. I am not sure if that's due to dismounting and remounting too quickly or because of the male and female horses or what exactly. Is there a way to forgetallhorses? Or something of the like..?

I will test more things out in the near future, but for tonight I don't have enough time unfortunately.
Just logged lightside to test this a bit... I think I'm seeing some of the same - what do you have set for the speed of your map out of curiosity? I'm mainly seeing the multiple highlights if im dismounting and mounting while moving around quickly with my map follow set to "fast"... I'm not entirely sure there's a way to deal with that - I think that's why most map-related scripts want the map set to "safe" or "slow" follow speed. (I'm not seeing the multiple room issue if i slow down my map to one of those) Personally I can't stand the slow map speeds... so then maybe highlighting isn't going to be a feasible thing? I'll keep playing and see what i can find.

Two things in the meantime - to fix the green squares in the short term: find another room that's the "correct" color you want the green room to go back to, go into that room and type %roomcol() and note the color code. Then go to your map, and either hover the mouse over the room with the incorrect green color, or right click it and hit properties and get the map room number (vnumber) - set the "lonelyhorse" variable to the room number of the green room, and the "startingcolor" variable to the color code you got earlier, then type forgethorse, and it should fix the room color.

Alternatively - as that feels like way too much work, i threw together a quick script - walk to a room that's the same color that the now green room *should* be and type savecolor, then walk to the green room and type fixcolor:

Code: Select all

#CLASS {fixcolors}
#VAR savedcolor ""
#ALIAS savecolor {#VAR savedcolor %roomcol()}
#ALIAS fixcolor {#CALL %maplocked( 0);#CALL %roomcol(,@savedcolor);#CALL %maplocked( 1)}
#CLASS 0
Secondly, here's the version without the highlighting, keeping just the seemingly decent working horseloc and gotohorse bits if/until the highlighting can be sorted to work a little better - just go to settings and delete the entire randomhorse class and re-paste this one in if desired:

Code: Select all

#CLASS {RandomHorseThing}
#VAR lonelyhorse 0
#TRIGGER {^you stop riding %1} {#VAR lonelyhorse %mapvnum()}
#TRIGGER {^you start riding %1} {#VAR lonelyhorse 0}
#ALIAS horseloc {#ECHO %ansi(green) You left a horse: %replace(%pathexpand(%pathfrom(,@lonelyhorse)),"|",";")}
#ALIAS gotohorse {#WALK @lonelyhorse}
#ALIAS forgethorse {#VAR lonelyhorse 0}
#CLASS 0

byrg
Posts: 394
Joined: Fri Aug 07, 2015 8:56 pm

Re: Idea : Horse dismount tracking script

Post by byrg » Thu Aug 25, 2016 11:05 pm

galfrey wrote:would it be possible for it to do it when you lose the horse after leading it too? i tried it out of curiosity and it works really well at the moment but would be good if it unhighlighted after lead and rehighlighted and recorded spams if the horse is lost while following you (for tunnels etc)

I dont have a clue how to do any of this at all so it was just a though, if its not possible im sure the people who use it will be fine with that was simply curious
Seems doable - i think it will be far more susceptible to the lag of being off a few rooms, especially if you're spamming somewhere with a horse following, but I'll try it out and see what I can manage.

Taziar
Posts: 961
Joined: Sat Mar 21, 2015 10:28 pm

Re: Idea : Horse dismount tracking script

Post by Taziar » Fri Aug 26, 2016 12:13 pm

Note on #ECHO vs. #SHOW

They both do the same thing mainly... Text displayed with #SHOW will fire any trigger that matches, where #ECHO will not. #SHOW also defaults to whatever your foreground text color is set to, #ECHO default color is set with the zMud system message color that you can set in color settings.

Taziar

Yeri
Posts: 109
Joined: Sat May 23, 2015 4:26 am

Re: Idea : Horse dismount tracking script

Post by Yeri » Fri Aug 26, 2016 6:50 pm

I figured out the highlighting issue - it has to do with how Zmud parses prompts. When commands are coming in quickly, output is given on the same line, like so:

* HP:Healthy MV:Full > You start riding him. <----- SAME LINE, DOESN'T BEGIN WITH 'You start riding' BECAUSE OF PROMPT

As opposed to what we're looking for, which is the un-lagged version:

* HP:Healthy MV:Full > ride horse
You start riding him. <------ NEW LINE

So the fix involves making sure your prompt is taken care of when matching:

^*> You start riding --> This is what I was going to propose, but: *BADGUY* hisses 'MY POWER IS LIMITLESS' > You start riding' matches it, so that's out.
^You start riding --> Needs no changes I think.

byrg
Posts: 394
Joined: Fri Aug 07, 2015 8:56 pm

Re: Idea : Horse dismount tracking script

Post by byrg » Fri Aug 26, 2016 9:56 pm

Yeri wrote:I figured out the highlighting issue - it has to do with how Zmud parses prompts. When commands are coming in quickly, output is given on the same line, like so:

* HP:Healthy MV:Full > You start riding him. <----- SAME LINE, DOESN'T BEGIN WITH 'You start riding' BECAUSE OF PROMPT

As opposed to what we're looking for, which is the un-lagged version:

* HP:Healthy MV:Full > ride horse
You start riding him. <------ NEW LINE

So the fix involves making sure your prompt is taken care of when matching:

^*> You start riding --> This is what I was going to propose, but: *BADGUY* hisses 'MY POWER IS LIMITLESS' > You start riding' matches it, so that's out.
^You start riding --> Needs no changes I think.
Just tested this using triggers without the newline character... you're definitely right - no more extra rooms... Good point on the prompt wildcard as well - maybe I'll try for a trigger that tries to check for says/chats/narrates/hisses/etc or some such.

byrg
Posts: 394
Joined: Fri Aug 07, 2015 8:56 pm

Re: Idea : Horse dismount tracking script

Post by byrg » Fri Aug 26, 2016 10:38 pm

So... a short term, but not fool-proof fix to the highlighting would really just be to nuke the newline characters from the triggers - the problem there being it does open you up to someone being a jerk and saying/emoting the commands. Even if you make a trigger of nested if statements to filter out says/hisses/etc, there's still the problem of emotes, as you can emote pretty much anything in the prompt... so i don't know that there's a flawless way to grab the non-newline mounts and dismounts without making it somewhat vulnerable to being messed with. Maybe some sort of regex to match the prompt... I'll keep playing.

Taziar
Posts: 961
Joined: Sat Mar 21, 2015 10:28 pm

Re: Idea : Horse dismount tracking script

Post by Taziar » Sat Aug 27, 2016 12:48 am

Name the triggers, and put the {disable} tag on them. Then either use an #ALIAS or #ONINPUT to enable the trigger when you want to use it. #T+ {triggerName} will turn it on. Then put #T- {triggerName} inside the trigger so that after it operates it turns itself back off.

#TRIGGER "triggerName" {pattern} {trigger operations} "" {disable}

This also optimizes zMud to be less laggy as each new line is not matched against a {disable} trigger. Imagine thousands of triggers checking every new line, turn most off and only have them on right before you need them will help greatly with that.

#T+ #T- will also turn on/off #CLASS so you could do that also... just turn the class on when you need it and off when you dont. No way to false trigger then.

Post Reply