<< Back to Programming Forum   Search

Posts 1 - 9 of 9   
Mod.Settings: 2017-12-07 21:39:10


ViralGoat 
Level 60
Report
I am following https://www.warzone.com/wiki/Mod_Hooks
and suddenly I am hit with the concept of Mod.Settings, which I understood what it is by looking at other mods. But where do I declare them?
Mod.Settings: 2017-12-07 21:45:15

Fizzer 
Level 64

Warzone Creator
Report
You set it in Client_SaveConfigureUI . See https://www.warzone.com/wiki/Mod_Game_Data_Storage

Edited 12/7/2017 21:46:41
Mod.Settings: 2017-12-07 22:12:45


ViralGoat 
Level 60
Report
OK so to get those values from the UI:

in Client_PresentConfigureUI.lua we set them
UI.CreateLabel(horz).SetText('Attacks per Multiattack(0=Infinit) ');
InputMaxAttacks = UI.CreateNumberInputField(horz).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(initialValue);


in Client_SaveConfigureUI we retrieve them

Mod.Settings.MaxAttacks = InputMaxAttacks.GetValue();


This kind of stuff is needed in a tutorial. I'll create a tutorial on the wiki.

Edited 12/7/2017 22:13:05
Mod.Settings: 2017-12-07 22:20:51


TBestLittleHelper
Level 50
Report
https://www.warzone.com/wiki/Mod_Developers_Guide

^That and knowing/assuming all the things you want to get from the game can be reached is really all you need too get a mod going. Then just go to the API Ref. site (found at the bottom of that page), and look up the call you need to make.

Not saying a tutorial is not helpful, but at least for me Mod_Dev. guide answered all my questions.

Edited 12/7/2017 22:21:26
Mod.Settings: 2017-12-07 23:35:08


ViralGoat 
Level 60
Report
Maybe I'm just hardheaded and I need step by step tutorials. I was doing good progress by following the Mod Developers Guide page, but then I lost a good half an hour trying to find how Mod.Settings works.

Then I understood what it is by looking at an example mod from dabo1.

Then Fizzer said that it was initialized in Client_SaveConfigureUI. That helped, but then, I didn't know how the variables get passed from the UI. There's nothing in the wiki that says that. You have to look at how other mods do it.

Edited 12/8/2017 05:53:15
Mod.Settings: 2017-12-08 05:26:31


dabo1
Level 57
Report
I understand that https://www.warzone.com/wiki/Mod_API_Reference suddenly just stops at the letter t and so the hole UI tutorial is missing now and has to be accessed over https://www.warzone.com/wiki/Mod_API_Reference:UI

Edited 12/8/2017 05:27:14
Mod.Settings: 2017-12-08 05:53:45


ViralGoat 
Level 60
Report
what do you mean by "stops at the letter t"?
Mod.Settings: 2017-12-08 06:04:29


dabo1
Level 57
Report
That at https://www.warzone.com/wiki/Mod_API_Reference the last entry is territorystanding. Maybe it is just a bug cause I got a mobile optimised page but the entry UI which is at the end of the page is missing for me.

EDIT: Maybe I was just wrong and it wasn't there(also not on PC version), I added it on the page now

Edited 12/8/2017 21:04:04
Mod.Settings: 2017-12-08 19:42:22


TBestLittleHelper
Level 50
Report
^Huh, you are right. It's only missing when checking on mobile.
Posts 1 - 9 of 9