You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


/!\ We have moved to a new board. Come join us. This board is now in "archive" (read-only mode). /!\

Dear visitor, welcome to Runes of Magic US / AU. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, November 5th 2015, 12:29am

modified addons: OSV

Spoiler Spoiler

Probably we all have some little tweaks and fixes for the addons we are using. Sometimes one line of lua can change a totally unusable cr*p into a beauty you cannot live without.

I would like to suggest we share such modifications - if you put effort in fixing something, why not let others benefit? :) And by sharing you might learn there is a better/easier way to do the same (I, for one, do hope to learn this :P ).


OK, so this one is about OSV.

But first a disclaimer: this is how I use OSV, it works for me, but if you want to follow this track - apply it on your own risk. And please: do not apply changes you do not understand!

1. Motivation

It's one of the obligatory addons. It's a bit like the scrut - if you don't have it you are no dps. :P Because the only way to get better is to measure and see every few percent difference, and stack these little differences until you are the god of Taborea. :D Well, OSV is kind of the same - if you don't see your values you won't notice that you miss a buff, you won't appreciate the buffs you get from others etc.

The main problem I had was that OSV does not have profiles. I play on the same toon R/M (yeah, I know, it's so 1990s...) and M/Wd. The values I want to see for both of them are very different. I could show all stats but then the screen is cluttered and this defeats the whole point of being able to notice immediately that you've lost somewhere 100 patt points.

Also - I hate it when I need to set things up manually in ui. That's why for me - always DIYCE, never kitty :P. And - I want to see the same values on all my mages - why would I need to set this up over and over again?

2. The changes

I register EXCHANGECLASS_SUCCESS: - changed line 142 from
Events = {"SAVE_VARIABLES","VARIABLES_LOADED","LOADING_END"},
to
Events = {"SAVE_VARIABLES","VARIABLES_LOADED","LOADING_END","EXCHANGECLASS_SUCCESS"},

I've introduced a new function: SetSettingsByClass()

Spoiler Spoiler


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function Functions.SetSettingsByClass()
	newtable = {
		GroupDigit = true,
		Scale = 12,
		PosX = -500,
		PosY = 180,
		Char = UnitName("player"),
	}

	-- ("ability" is row number in abilitylist)
	local mainClass, subClass = UnitClassToken("player");
	-- specific magic combos: W/M and K/M
	if (mainClass == "KNIGHT" and subClass == "MAGE") or (mainClass == "WARRIOR" and subClass == "MAGE") 
		or (mainClass == "MAGE") or (mainClass == "HARPSYN")
	then
		-- "MAGE"
		-- "HARPSYN" -> Wl
		-- Druid?
		-- DEBUG_MSG("-- -- -- -- -- MAGICAL -- -- -- -- --")
		newtable[1]={ability = 13, custom = "mATT"}
		newtable[2]={ability = 12, custom = "mDMG"}
		newtable[3]={ability = 14, custom = "mCRIT", percent = false}
		-- newtable[4]={ability = 28, custom = "INT"}
	elseif (mainClass == "AUGUR") or (mainClass == "DRUID") then
		-- "AUGUR" -> P
		-- Druid?
		-- DEBUG_MSG("-- -- -- -- -- HEAL -- -- -- -- --")
		newtable[1]={ability = 12, custom = "mDMG"}
		newtable[2]={ability = 14, custom = "mCRIT", percent = false}
		newtable[3]={ability = 15, custom = "Heal"}
		-- newtable[4]={ability = 29, custom = "WIS"}
	elseif (mainClass == "KNIGHT") or (mainClass == "PSYRON") or (mainClass == "WARDEN") or (mainClass == "THIEF") or (mainClass == "WARRIOR") then
		-- "PSYRON" is Ch
		-- DEBUG_MSG("-- -- -- -- -- PHYSICAL -- -- -- -- --")
		newtable[1]={ability = 3, custom = "pATT"}
		newtable[2]={ability = 6, custom = "pDMG"}
		newtable[3]={ability = 4, custom = "pCRIT", percent = false}
		-- newtable[4]={ability = 25, custom = "STR"}
		-- newtable[5]={ability = 26, custom = "DEX"}
	else
		-- RANGER
		-- DEBUG_MSG("-- -- -- -- -- RANGE -- -- -- -- --")
		newtable[1]={ability = 9, custom = "rATT"}
		newtable[2]={ability = 11, custom = "rDMG"}
		newtable[3]={ability = 10, custom = "rCRIT", percent = false}
		-- newtable[4]={ability = 25, custom = "STR"}
		-- newtable[5]={ability = 26, custom = "DEX"}
	end

	return newtable
end


- that's where the magic happens, I guess it's quite clear. If you want different settings per character you can add conditions based on the character's name etc. You can also add other statistics or change descriptions etc. If you play D/R you should add it to the magical part. And so on. But the defaults as above are a pretty good starting point imho. Note that I also have a fixed hardcoded position on the screen! This one you will definitely need to adjust to your needs.

in 'if event == "LOADING_END" then' I've kicked out the calls to Copytable() and instead call Settings = Functions.SetSettingsByClass()

and added a part for the class-change event:

Source code

1
2
3
	elseif event == "EXCHANGECLASS_SUCCESS" then
		Settings = Functions.SetSettingsByClass()
		Functions.MainApplySettings()


3. Result
On all toons, when I log in or whenever I change classes I always have statistics appropriate to the curretn class combo. Voilà.

I attach the full modified osv.lua (renamed as osv.txt because of stupid controversial forum rules - just rename it as osv.lua).

As always:
* ALWAYS keep backup of old files;
* if you edit the files yourself always use notepad++, never the notepad from windows;
* in this case you might want to keep a copy of SaveVariables.lua and a copy of your-character settings folder (e.g. if my hardcoded position is completely off your screen and you have problems setting it back to right values)

Yeah, it's not very consistent to ignore loaded values but still to save the new ones, but look - it's not a proper "release-ready" change, just something that fixes with the least effort what was inconvenient for me. :P
Uure has attached the following file:
  • osv.txt (33.23 kB - 56 times downloaded - latest: Jan 31st 2018, 7:49pm)
>>>> >>>> >>>>
>>>>
>>>> Please, bring back (bound if there is no other option) dias to AH! :thumbsup:
>>>> If you do this we will all love you forever. ;)
>>>>
>>>> >>>> >>>>

2

Thursday, November 5th 2015, 2:08am

Nice addition to the addon, I was always too lazy to change it for every class so I pretty much had everything all the time lol. Added in all the lines I needed for various classes and it works well. Only thing I noticed is the default damages you had in there for melee and range are actually the accuracies :P
Callmepapabear - Erebos (Formerly Osha)
Storyteller and Cenedrils - 190,219 PA R/M - 196,201 PA S/R
I upload vids now and then
https://www.youtube.com/channel/UCaaIokqEpV_7X7NTi_bADlg