RandomMount: A Random Mount Selector For Windower

Langues: JP EN DE FR
users online
Forum » Windower » General » RandomMount: A random mount selector for Windower
RandomMount: A random mount selector for Windower
First Page 2
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2018-03-19 02:56:24
Link | Citer | R
 
Edit: This is now called MountRoulette and is available via the addon section of the Windower launcher.

Hi all,

I wanted to share an addon I've created that mimics the Mount Roulette function in FFXIV which selects a mount at random.

https://github.com/xurion/ffxi-mount-roulette

You use the multifunctional //mr command to mount a random mount, as well as dismount if you're currently mounted.

I have personally bound this to my = key for ease of use.

Please give it a go and lemme know if you encounter any issues or if you have any suggestions!

Thanks in advance!
[+]
 Asura.Lobbi
Offline
Serveur: Asura
Game: FFXI
user: Lobby
Posts: 8
By Asura.Lobbi 2018-03-19 07:00:36
Link | Citer | R
 
Nice idea!


Regarding the code, I would suggest to check ki just once, when zoning, instead of doing it at each time tick.
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2018-03-19 08:35:11
Link | Citer | R
 
Thanks :)

I tried that, but the issue is, similar to how your inventory loads after you zone, your key items load in batches. Currently I have 606 key items, and on each time tick, I saw something like 107, then 268, then 491 etc. so I at this time I have no idea how to reliably grab all KIs.

I guess I could set a maximum number of event ticks per zone. Once the ticks had happened, I could stop the event.
 Asura.Chiaia
VIP
Offline
Serveur: Asura
Game: FFXI
user: Demmis
Posts: 1405
By Asura.Chiaia 2018-03-19 08:43:02
Link | Citer | R
 
Bismarck.Xurion said: »
Thanks :)

I tried that, but the issue is, similar to how your inventory loads after you zone, your key items load in batches. Currently I have 606 key items, and on each time tick, I saw something like 107, then 268, then 491 etc. so I at this time I have no idea how to reliably grab all KIs.

I guess I could set a maximum number of event ticks per zone. Once the ticks had happened, I could stop the event.

Could store the KI(s) 20 seconds after logging in or on load of the addon. If it's been less then 20 seconds since login default to raptor. I've never had a problem zoning and instantly picking any mount I have. So it shouldn't require your KIs to be loaded. If I am wrong sorry just an idea for you. I haven't ever had the desire to mess with mount stuff before.
 Sylph.Siccmade
Offline
Serveur: Sylph
Game: FFXI
Posts: 1058
By Sylph.Siccmade 2018-03-19 10:57:52
Link | Citer | R
 
Definitely gonna give it a go when I can log on, I try to manually random as is, lol.
Offline
Posts: 104
By Feanorsof 2018-03-19 11:11:07
Link | Citer | R
 
Works very well, already set binds on all my lua and enjoying the randomness
 Lakshmi.Buukki
Offline
Serveur: Lakshmi
Game: FFXI
By Lakshmi.Buukki 2018-03-19 11:23:02
Link | Citer | R
 
Lovely, will use. Can you configure it to change out that horrible "mount" music, to something appropriate? Nothing kills the vibe more than looking like a Dvergr King on top of your floating throne and you got the Smooth McGroove tunes playing in the background....
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2018-03-19 11:55:16
Link | Citer | R
 
Thanks all so far!

Yeah I hate the music too. I could use that addon as a dependency and set the music to whatever. Let me have a think :)

Also, as a quick win, you could set a bind doing the following:

bind %= "//rm; //setbgm <music id>"

Replace <music id> with the ID from the usual setbgm list. This should mount and play desired music. I'm not at home at the moment so can't test it.

Edit: MountMuzzle in the launcher takes care of this very well.
 Sylph.Siccmade
Offline
Serveur: Sylph
Game: FFXI
Posts: 1058
By Sylph.Siccmade 2018-03-19 11:56:48
Link | Citer | R
 
Or just watch Netflix. lol
[+]
Offline
Posts: 694
By Nyarlko 2018-03-19 16:23:34
Link | Citer | R
 
Maybe instead of rechecking automatically for KIs, you could check on character login and save what's available as a settings file?

It should be impossible for a specific character's list to ever get smaller, so you really only need that initial setup and then verify regularly that nothing's been added to the current character's list.
 Shiva.Trumpy
Offline
Serveur: Shiva
Game: FFXI
user: Trumpy3k
Posts: 19
By Shiva.Trumpy 2018-03-26 00:32:32
Link | Citer | R
 
so would you have to regularly update it so it knows new KIs are mounts, or is there some kind of tag in game that lets you know its a mount.

couple years back i asked for help on BG making a random mounting addon, i called it mountup. we got something working and one of the guys had some stuff that checked KIs but i dunno how to find that info and it would have been needed to add to the lua everytime they were added. So i altered it and just made a table where i put what mounts i wanted to be available. works like a charm.

I still have the original lua, that has the key item stuff but i dont believe its triggered in the lua as i also have the table system i used in there as well. I tried to repeat mount names to give some a heavier weight (aka i want to see them more often) but it didnt seem to work any different than having them in the list once each. Ill try to remember to check this thread later and see if ur interested in seeing it.
 Bismarck.Dekusutaa
Offline
Serveur: Bismarck
Game: FFXI
user: dekusutaa
Posts: 466
By Bismarck.Dekusutaa 2018-03-26 01:16:31
Link | Citer | R
 
Would be nice to include an option to toggle off mount music entirely and listen to the zone music!
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2018-03-26 01:52:13
Link | Citer | R
 
Bismarck.Dekusutaa said: »
Would be nice to include an option to toggle off mount music entirely and listen to the zone music!

Cool I'll look into what the BGM addon can do :)

Shiva.Trumpy said: »
so would you have to regularly update it so it knows new KIs are mounts, or is there some kind of tag in game that lets you know its a mount.

Na, Windower provides the resources utility, which allows you to gain access to all items, key items, spells etc. with their IDs and categories. I cross reference the player's mount key items against the key item resources. The Windower guys are great at keeping the resources up to date!

Resources can be found here: https://github.com/Windower/Resources/tree/master/lua

An example of use would be:
Code
local resources = require('resources')
for k,v in pairs(resources.key_items) do
    if v.category == "Mounts" then
        print(v.en)
    end
end
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2018-03-26 05:46:19
Link | Citer | R
 
Bismarck.Xurion said: »
Bismarck.Dekusutaa said: »
Would be nice to include an option to toggle off mount music entirely and listen to the zone music!

Cool I'll look into what the BGM addon can do :)

SetBGM addon doesn't allow this at the moment, but a quick look at their code shows that they inject packets to set the BGM.

If I'm honest, I need to look a lot more into Windower and packets. If anyone has any good guides on them, that'd be appreciated (and hopefully an end to mount music u_u;).
 Bahamut.Ivebian
Offline
Serveur: Bahamut
Game: FFXI
user: Smg1388
Posts: 39
By Bahamut.Ivebian 2018-03-26 17:29:47
Link | Citer | R
 
You can block a packet by returning true. The 5th byte of 0x5F is music type and bytes 7-8 is the song id.
Type 4 is chocobo/mount so removing "and data:byte(7) == 84" from the below will block both tracks.
Code
windower.register_event('incoming chunk', function(id, data)
    if id == 0x5F and data:byte(5) == 4 and data:byte(7) == 84 then
        return true
    end
end)


Also you can build a table from the packet that populates your mount list, incoming 0xAE. There's a few second delay on zoning, so if you wanted to get rid of that you can use this in the incoming chunk event and update the table when the packet changes.
Code
    local data = windower.packets.last_incoming(0xAE)
    local t = {}
    for x=0,63 do
        if data:unpack('b', math.floor(x/8)+5, x%8+1) == 1 then
            t[#t+1] = x
        end
    end

    if #t == 0 then return end

    local mountid = t[math.random(1,#t)]

Now you only need to check resources to get the name of the mount you're going to call. At this point you could just inject outgoing action packet and not bother loading the resources into memory.
[+]
necroskull Necro Bump Detected! [91 days between previous and next post]
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2018-06-25 07:51:50
Link | Citer | R
 
Bismarck.Dekusutaa said: »
Would be nice to include an option to toggle off mount music entirely and listen to the zone music!
Thanks to Ivebian who got me started with useful information about packets etc. I've taken what he gave in his last post and adapted it so, by default, mount music is disabled and can be re-enabled with //rm music.

Enjoy :3

Edit: This is no longer part of the addon. Look into using MountMuzzel in the Windower launcher.
necroskull Necro Bump Detected! [684 days between previous and next post]
 Bahamut.Yzerman
Offline
Serveur: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-05-09 13:47:55
Link | Citer | R
 
Would it be fairly simple to make a "Use/Cast Random" script with Windower if you just wanted to select randomly each time from 3 or 4 mounts that I name in the script?

Similar to:
/castrandom (Tulfaire, Warmachine, Fenrir)
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2020-05-09 15:09:15
Link | Citer | R
 
The addon will soon support blacklisting certain mounts if that helps?
 Asura.Aeonova
Offline
Serveur: Asura
Game: FFXI
user: aeonova
Posts: 2085
By Asura.Aeonova 2020-05-09 19:23:20
Link | Citer | R
 
I love the idea of this. I just have one mount macro'd and get tired of it so I sometimes open my mount list and close my eyes and press up and down a bunch to try to randomize it manually that way. This is... better.
[+]
Offline
Posts: 12332
By Draylo 2020-05-09 19:26:20
Link | Citer | R
 
I want a shark mount, they added the shark Naakul in FFXIV as a mount before the game that created it :|. We need a mount for each Naakul, I would love to rid Hurkan and Tojil :)
 Bahamut.Yzerman
Offline
Serveur: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-05-23 20:46:23
Link | Citer | R
 
Sorry to ask again, but I'm going over your code and I see where you create a table:
table.insert(mount_kis, ki.en)

Instead of having your addon search for mount KIs every second, would it be possible to have your addon use.random from a table we manually create?

I've learned some SQL and web coding, but I don't know enough lol.

Something like:
table(Chocobo, Raptor, Fenrir)

where we put the names in ourselves.

Then in the random number part, make sure we designate the ceiling ourselves as well (3 in this ex).

Could we also have it with conditionals? Like with GearSwap, you have Playername_JOB. We could generate our own lists for each of our characters AND even specify jobs?

I'm SORTA understanding your code with my very rudimentary grasp of...python? lol, I don't even know the language...
 Asura.Aeonova
Offline
Serveur: Asura
Game: FFXI
user: aeonova
Posts: 2085
By Asura.Aeonova 2020-05-23 22:46:39
Link | Citer | R
 
Draylo said: »
I want a shark mount, they added the shark Naakul in FFXIV as a mount before the game that created it :|. We need a mount for each Naakul, I would love to rid Hurkan and Tojil :)

Sleipnir when?
Offline
Posts: 12332
By Draylo 2020-05-23 23:51:43
Link | Citer | R
 
Oh I didn't think of that, that would be neat too
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2020-05-24 16:27:01
Link | Citer | R
 
Bahamut.Yzerman said: »
Sorry to ask again, but I'm going over your code and I see where you create a table:
table.insert(mount_kis, ki.en)

Instead of having your addon search for mount KIs every second, would it be possible to have your addon use.random from a table we manually create?
I'm going to re-write this addon soon as I used it as a learning experience and there are many inefficiencies with it, like the one you named. Plus there's additional functionality that it should not be responsible for, such as muting the mount music (which I included before MountMuzzle was available).

If I understand your idea correctly, the default behaviour should remain the same so the addon does not burden everyday users with needing to define a list.

What it could do is allow you to set a list of mounts to use like so:
Code
//rm only raptor tiger "red crab"


In my opinion, no addon should ever need you to edit the code to configure it.
 Bahamut.Yzerman
Offline
Serveur: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-05-24 19:47:39
Link | Citer | R
 
That would actually be perfectly awesome.

I'm used to editing LUAs in GS so it wouldn't be much of a stretch for me lol, but your "fix" would be exactly what I'm looking for.
[+]
necroskull Necro Bump Detected! [30 days between previous and next post]
 Bahamut.Yzerman
Offline
Serveur: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-06-24 05:56:00
Link | Citer | R
 
Any progress on this change to the //rm addon? My tinkering has provided no fruit :(
necroskull Necro Bump Detected! [48 days between previous and next post]
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2020-08-11 03:21:12
Link | Citer | R
 
Update: did the rewrite of the addon and renamed it to MountRoulette - the name is pulled from XIV where the idea first came from. It is also now available via the addon section in the Windower launcher.

Rewriting was required before adding features like blacklist etc. There is an issue with saved settings/config that needs to be resolved before a blacklist can reliably function.
Offline
Posts: 12332
By Draylo 2020-08-11 05:17:25
Link | Citer | R
 
What changed? I liked this a lot
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 534
By Bismarck.Xurion 2020-08-11 12:26:53
Link | Citer | R
 
Just the way it checked for KIs - it was very inefficient as I used it as a learning experience way back when. The premise is the same.
First Page 2
Log in to post.