
Ordush
Elite user-
Posts
1178 -
Joined
-
Last visited
Content Type
Forums
Articles
Bug Tracker
Downloads
Store
Everything posted by Ordush
-
[PAID] [PVE] [RAID] Restoration - Druid - TBC(2.4.3) by Ordush
Ordush commented on Ordush's file in Fight Classes - TBC
- 85 comments
-
- tbc
- fightclass
-
(and 5 more)
Tagged with:
-
This is a problem because if you play with other hunters, you won't be able to use Serpent Sting. Just imagine being a resto druid with another resto druid in party. ;)
-
If you use "Target Buff Casted by Me" in the fight class editor, it doesn' have any effect. Example: I use serpent sting on target, and tell it to only use serpent sting if target doesn't have the buff made by me called serpent sting. It will keep spamming serpent sting. If you use the "Target Buff" and set it to Serpent Sting and false, it will not spam Serpent Sting. Reason why this is: In TBC the UnitBuff filter " PLAYER " is not a thing in the UnitBuff Table.
-
That did not work, it just gives the error: Couldn't find CVar named 'HuntersMarkDisabled'. However i did fix it by doing this: [Serializable] public class HunterBeastmasterSettings : Settings { const string FILE_PREFIX = "CustomClass-HunterBeastmaster"; [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Hunter's Mark Disabled")] [Description("Is Hunter's Mark Disabled?")] public bool HuntersMark { get; set; } [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Steady Shot")] [Description("Use Steady Shot")] public bool SteadyShot { get; set; } HunterBeastmasterSettings() { ConfigWinForm(new System.Drawing.Point(400, 400), "HunterBeastmaster " + Translate.Get("Settings")); } public static HunterBeastmasterSettings CurrentSetting { get; set; } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName(FILE_PREFIX, ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<HunterBeastmasterSettings>(AdviserFilePathAndName(FILE_PREFIX, ObjectManager.Me.Name + "." + Usefuls.RealmName)); CurrentSetting.FetchFromLua(); // SETTINGS LOADED, MUST BE TRANSLATED TO LUA return true; } CurrentSetting = new HunterBeastmasterSettings(); } catch (Exception e) { Logging.WriteError(FILE_PREFIX + " load error: " + e); } return false; } public bool Save() { try { CurrentSetting.PushToLua(); // LOAD SETTINGS FROM LUA return Save(AdviserFilePathAndName(FILE_PREFIX, ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError(FILE_PREFIX + " save error: " + e); return false; } } void FetchFromLua() { HuntersMark = Lua.LuaDoString<bool>("return HuntersMarkDisabled"); } void PushToLua() { if (HuntersMark) { Lua.LuaDoString("HuntersMarkDisabled = true"); } else { Lua.LuaDoString("HuntersMarkDisabled = false"); } } } With that code, i don't combine C# and Lua in same string. But it does what it is supposed to. It also does change in the settings and changes in-game if i change it in the settings. So all is good. However, when i reload the game, it seems as if the FetchFromLua Happens before the PushFromLua so it resets to false because of that. This does make sense since it's supposed to fetch from lua on load, but if i swap the two so it fetches on save and pushes on load, then nothing works.
-
Thanks for the tips, i will give it a try. :)
-
I will just make an example of how i'd love for this to work. :) SLASH_TOGGLEHUNTERSMARK1 = '/togglehuntersmark' SlashCmdList.TOGGLEHUNTERSMARK1=function() if HuntersMarkDisabled then HuntersMarkDisabled = false else HuntersMarkDisabled = true end end Then the condition is set to HuntersMarkDisabled false to use hunters mark. Works very well without any problems. Now the problem is i relog the game HuntersMarkDisabled is reset (due to the variable no longer being true/false). So camelot10 came up with the code above, so that my HuntersMarkDisabled would be stored with the Fight Class settings. Here the problem is that when it does Lua.LuaDoString("HuntersMarkDisabled = " + HuntersMark); it doesn't turn HuntersMarkDisabled into what HuntersMark is, but it just sets it to nil. Hope someone can help with this problem. :)
-
It still turns HuntersMarkDisabled into nil no matter what it's set to. Instead of true/false it turns into nil. =/
-
Once again Thanks a ton Camelot!
-
[PAID] [PVE] [RAID] Beastmaster - Hunter - 1-70 - TBC(2.4.3) by Ordush
Ordush commented on Ordush's file in Fight Classes - TBC
- 91 comments
-
[PAID] [PVE] [RAID] Beastmaster - Hunter - 1-70 - TBC(2.4.3) by Ordush
Ordush commented on Ordush's file in Fight Classes - TBC
- 91 comments
-
Hey all, i've been tinkering with importing settings into in-game lua variables. With the help of camelot10 I'm almost there getting everything to work. void FetchFromLua() { HuntersMark = Lua.LuaDoString<bool>("return HuntersMarkDisabled"); } This works great, as it changes my setting based on the in-game variable HuntersMarkDisabled. The problem is, when i want to send that data back to the game after a new session. I use. void PushToLua() { Lua.LuaDoString("HuntersMarkDisabled = " + HuntersMark); } Which should set the variable HuntersMarkDisabled to whatever HuntersMark was in C# before. Now, what happens is: This turns HuntersMarkDisabled into nil instead of true/false My guess is that, what it is doing is: It's looking for the lua Variable HuntersMark instead of C#. Any help would be appreciated! :) Edit: Here is all my code: [Serializable] public class HunterBeastmasterSettings : Settings { private bool _huntersmark = true; [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Hunter's Mark Disabled")] [Description("Is Hunter's Mark Disabled?")] public bool HuntersMark { get { return _huntersmark; } set { _huntersmark = value; } } private bool _steadyshot = true; [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Steady Shot")] [Description("Use Steady Shot")] public bool SteadyShot { get { return _steadyshot; } set { _steadyshot = value; } } private HunterBeastmasterSettings() { ConfigWinForm(new System.Drawing.Point(400, 400), "HunterBeastmaster " + Translate.Get("Settings")); } public static HunterBeastmasterSettings CurrentSetting { get; set; } public bool Save() { try { return Save(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<HunterBeastmasterSettings>(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); CurrentSetting.PushToLua(); CurrentSetting.FetchFromLua(); return true; } CurrentSetting = new HunterBeastmasterSettings(); } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Load(): " + e); } return false; } void FetchFromLua() { HuntersMark = Lua.LuaDoString<bool>("return HuntersMarkDisabled"); } void PushToLua() { Lua.LuaDoString("HuntersMarkDisabled = " + HuntersMark); } }
-
So yeah, another problem. The CurrentSetting.PushToLua(); Overwrites the settings and sets everything to what default is, because it loads the settings before it does FetchFromLua. I tried doing try { if (File.Exists(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<HunterBeastmasterSettings>(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); if (Updateloaded) { CurrentSetting.PushToLua(); } return true; } CurrentSetting = new HunterBeastmasterSettings(); } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Load(): " + e); } return false; So it would first push the lua after it had loaded the settings, but that did not work. apparently i can't make an if there. Any help would be appreciated.
-
I just went into the shower, while there i think i figured it out. If i write the code you see above, and then start my fight class with a c# code (using the editor) And i in that code write the following: if (Updateloaded != true) { Updateloaded = true FetchFromLua(); } Then it should update my variables before displaying/using them for the rest of the fight class right? Meaning that would be how i load them form last session? :)
-
My C# Knowledge level is almost non existent, which is why i've written my fightclass in lua. This is also why i was asking if anyone knew of a way to do this with lua. :) Edit: When it comes to C# I can read examples and modify them for my needs.
-
I hit a roadblock here It does change the setting if i click settings based on what i set HuntersMarkDisabled to in-game, but in-game doesn't change based on what it's set to in the settings (So it saves to settings, but doesn't load from settings) [Serializable] public class HunterBeastmasterSettings : Settings { [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Hunter's Mark Disabled")] [Description("Is Hunter's Mark Disabled?")] public bool HuntersMark { get; set; } [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Steady Shot")] [Description("Is Hunter's Mark Disabled?")] public bool SteadyShot { get; set; } public static HunterBeastmasterSettings CurrentSetting { get; set; } private HunterBeastmasterSettings() { } public bool Save() { try { return Save(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<HunterBeastmasterSettings>(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } else { CurrentSetting = new HunterBeastmasterSettings { HuntersMark = false, SteadyShot = false, }; } CurrentSetting.PushToLua(); return true; } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Load(): " + e); } return false; } void PushToLua() { HuntersMark = Lua.LuaDoString<bool>("return HuntersMarkDisabled"); } void FetchFromLua() { Lua.LuaDoString("HuntersMarkDisabled = " + HuntersMark); } } I tried adding CurrentSetting.FetchFromLua(); to the "try" under load. Do i need to rewrite the load, like the save has been rewritten for it to work? :)
-
Cheers! Makes sense!
-
Thank you for giving me a straight answer! It's very appreciated. If i understand you right, i should be able to set lua vars using C#. I am obviously not very good at C#. I will give it a try looking through the code that people used to make settings (the links you lastly provided). And see if i can figure out how to use that to set lua vars. That was all i asked for mate. Thanks
-
And i appreciate any help i can get, but i don't understand why you have to be rude about it? Yes it took you 5 minutes to get how to use C# for saving/loading data/params. What i asked was if/how i can use lua to do it. The reason i ask for lua is because i write my fightclasses in lua not C#. Without any reason at all you keep telling me how much i suck at using google etc. I am not being aggressive, quite the opposite, i am being defensive because you keep being rude to me instead of just telling me: "I don't know if you can do it in lua".
-
What is wrong with you? There is NO reason at all to be rude at all... Being arrogant and rude has no place in a public debate area. Clearly i can't seem to get where you want me to go, you could just point me directly to where you want me to go instead of making rude gestures and posting links to a "how to use google" site. I am not being rude to you in any way. Your behavior is so weird... If anyone asks a question on this forum and i know the answer, i will answer the question, and i will point to where people can find the help they need if i know where. Edit: In short: Can you just tell me weather robotManager.Helpful.Settings Can work with lua or not? If you don't know, that is fair enough.
-
And i allrdy did google it before you linked the "how to google" guide.. If you click your own link you will see there are 6 links, and none of them has any info on how to use robotManager.Helpful.Settings
-
No reason to be rude. I always search every bit of the internet before i begin asking quetions. I will try see if i can figure it out. Thanks.
-
Can i do that combined with Lua? if so, would you explain it to me? Cheers!
-
Yeah the problem here is exactly that it's cleared. The reason i was using an addon instead was because i want it to save my variables between game sessions. When you close the game and wrobot, from what i understand Var.SetVar and Var.GetVar clears and then we're back to default, thereby losing the saved data?
-
So i've tested this out, and ofc. it works fine it remembers the variables i set. The problem is that it does actions based on those variables which are blocked by blizzard. So the first thing that happens when i do anything using those variables i have saved in my ToC (SavedVariables) blizzard blocks my addon. Is there not any way to save lua variables without using SavedVariables in-game? Since addons are also checked for secure usage.
-
[DEMO] [PVE] Beastmaster - Hunter - TBC(2.4.3) by Ordush
Ordush commented on Ordush's file in Fight Classes - TBC
- 6 comments
-
- fightclass
- tbc
-
(and 2 more)
Tagged with: