RandomMount: A Random Mount Selector For Windower

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » General » RandomMount: A random mount selector for Windower
RandomMount: A random mount selector for Windower
First Page 2 3
 Bismarck.Xurion
Offline
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-03-19 02:56:24
Link | Quote | Reply
 
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
Server: Asura
Game: FFXI
user: Lobby
Posts: 15
By Asura.Lobbi 2018-03-19 07:00:36
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-03-19 08:35:11
Link | Quote | Reply
 
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
Server: Asura
Game: FFXI
user: Demmis
Posts: 1652
By Asura.Chiaia 2018-03-19 08:43:02
Link | Quote | Reply
 
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
Server: Sylph
Game: FFXI
Posts: 1066
By Sylph.Siccmade 2018-03-19 10:57:52
Link | Quote | Reply
 
Definitely gonna give it a go when I can log on, I try to manually random as is, lol.
Offline
Posts: 116
By Feanorsof 2018-03-19 11:11:07
Link | Quote | Reply
 
Works very well, already set binds on all my lua and enjoying the randomness
 Lakshmi.Buukki
Offline
Server: Lakshmi
Game: FFXI
By Lakshmi.Buukki 2018-03-19 11:23:02
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-03-19 11:55:16
Link | Quote | Reply
 
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
Server: Sylph
Game: FFXI
Posts: 1066
By Sylph.Siccmade 2018-03-19 11:56:48
Link | Quote | Reply
 
Or just watch Netflix. lol
[+]
Offline
Posts: 703
By Nyarlko 2018-03-19 16:23:34
Link | Quote | Reply
 
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
Server: Shiva
Game: FFXI
user: Trumpy3k
Posts: 27
By Shiva.Trumpy 2018-03-26 00:32:32
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: dekusutaa
Posts: 494
By Bismarck.Dekusutaa 2018-03-26 01:16:31
Link | Quote | Reply
 
Would be nice to include an option to toggle off mount music entirely and listen to the zone music!
 Bismarck.Xurion
Offline
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-03-26 01:52:13
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-03-26 05:46:19
Link | Quote | Reply
 
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
Server: Bahamut
Game: FFXI
user: Smg1388
Posts: 39
By Bahamut.Ivebian 2018-03-26 17:29:47
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-06-25 07:51:50
Link | Quote | Reply
 
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
Server: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-05-09 13:47:55
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2020-05-09 15:09:15
Link | Quote | Reply
 
The addon will soon support blacklisting certain mounts if that helps?
 Asura.Aeonova
Offline
Server: Asura
Game: FFXI
user: aeonova
Posts: 3113
By Asura.Aeonova 2020-05-09 19:23:20
Link | Quote | Reply
 
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.
[+]
Online
By Draylo 2020-05-09 19:26:20
Link | Quote | Reply
 
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
Server: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-05-23 20:46:23
Link | Quote | Reply
 
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
Server: Asura
Game: FFXI
user: aeonova
Posts: 3113
By Asura.Aeonova 2020-05-23 22:46:39
Link | Quote | Reply
 
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?
Online
By Draylo 2020-05-23 23:51:43
Link | Quote | Reply
 
Oh I didn't think of that, that would be neat too
 Bismarck.Xurion
Offline
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2020-05-24 16:27:01
Link | Quote | Reply
 
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
Server: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-05-24 19:47:39
Link | Quote | Reply
 
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
Server: Bahamut
Game: FFXI
user: rslogic
Posts: 4
By Bahamut.Yzerman 2020-06-24 05:56:00
Link | Quote | Reply
 
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
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2020-08-11 03:21:12
Link | Quote | Reply
 
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.
Online
By Draylo 2020-08-11 05:17:25
Link | Quote | Reply
 
What changed? I liked this a lot
 Bismarck.Xurion
Offline
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2020-08-11 12:26:53
Link | Quote | Reply
 
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 3
Log in to post.