EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Can I change my petwindow midgame? (https://www.eq2interface.com/forums/showthread.php?t=11596)

cybersmurf 09-14-2008 04:46 AM

Can I change my petwindow midgame?
 
I was wondering if its at all possible to have a pet-window that changes depending on which pet I summon?
Something like:

If summoned=airpet then
button1-function=shadowstep;attack;
else if summoned=earthpet then
button1-function=attack;

I know how to assing a button multiple functionality, its just the if/else part I'm unsure about.

Is there a workaround like doing a /load_ui airpetwindow, /load_ui firepetwindow etc.. before casting the pet?

Just found out some UIs use Class Detection Triggers, could this be used for pets and if so - how?

Thanks in advance
Flaxer
Befallen

gm9 09-14-2008 06:24 AM

Moved your post to the XML modding help forum, in here you'll find a sticky that explains conditionals (if then else statements). You can probably grab the pet type by checking for the name in the effects window.

EQAditu 09-15-2008 01:32 PM

Assuming you can find your moved post again... what you want to do seems entirely possible, though it would probably result in a longer script than you were intending. Mostly because as gm9 said, probably the only way to detect your pet type is to check the spell name on up to 30 maintained spell icons.

If you're up for it, I can write generally what you'd have to accomplish.

You'll need some text elements holding the maintained icon's spell names. (Repeat 30x)
Code:

<Text Name="Icon01Name" Visible="false" DynamicData="/GameData.Maintained.Spell_1.Name" />
You'll need some UI script to check the icon text for your pet buff name.(Repeat 30x)
Code:

MATCH=Parent.DynamicDataPage.Icon01Name.LocalText==SearchName
Found=MATCH ? true : Found

Some hidden Page or Button elements with OnShow/OnActivate handler scripts to do your different commands. (One element pet pet type)
Code:

<Page Name="FirePetPage" Visible="false" OnShow="Visible=false do_some_commands" />
Then you'll need some code to do your branching once you have checked all of the icons for each of the pet names.
Code:

Parent.FirePetPage.Visible=FIREPETFOUND
Parent.EarthPetPage.Visible=EARTHPETFOUND

Only one of the booleans should be true(think switch/case block), so only one page should be made visible causing its OnShow event to be triggered. Hide an element after making it visible so you can use it a second time.

That's generally how I would make it... though there are certainly some parts I left out aside from repeating things 30x.

Drumstix42 09-15-2008 01:52 PM

Another possibility could be to take away the default icons from the pet window. Code up custom ones that have different functionality for each pet.

Then, to change the window functionality, set a variable when you cast the correct pet.

Either check the spell being cast...? Or set the variable in a hotbutton that casts the pet.

Thoughts?

EQAditu 09-15-2008 02:02 PM

Checking the spell being cast does sound quicker. You just need to create your own DynamicData spell name element like:
Code:

<Text Name="SpellName" DynamicData="/GameData.Spells.Casting" LocalText="NoSpell" Size="0,0" Visible="false" OnShow="do_checking_based_on_LocalText/>
Replace OnShow with actual code that checks for the LocalText matching a pet spell name.

gm9 09-15-2008 04:58 PM

Easiest is probably a toggle button on the pet window. :)

EQAditu 09-15-2008 06:49 PM

Pfft, that's too simple!

It sounded like the OP wanted something at least a tiny bit automatic though.

Drumstix42 09-15-2008 11:29 PM

I mean... it's close enough with what was said above:

Make an invisible button on pet window.
Press button when casted spell name matches correct button, that toggles the functions.

cybersmurf 09-16-2008 08:15 AM

Thanks for all the great answers.
I think I'll pick up a book on XML-programming before throwing myself at this project :)
All my mods up till now have been slight modifications of already good mods so they would fit a conjuror, but I'm not completely sure how it actually works with pages and all the viriables available :o
But thank you for now, and I'll probably return when/if I get around to actually learning xml.

Kind regards
Flaxer
Befallen

EQAditu 09-16-2008 12:01 PM

Well... I don't think you'll find a book on this. This isn't XML programming as there is no such thing. The XML files are formatted markup language, true... but saying XML programming is like saying HTML programming. It's a poor term as any programming isn't in HTML but JavaScript or ASP/PHP etc.

The UI scripting is specific to EQ2 and pretty much the only source you're going to find on learning that is here in these forums or by looking at premade mods. Oh, and the UI documentation that SoE provides.

Drumstix42 09-16-2008 02:01 PM

And to add to that, the scripting possible through the UI isn't really anything specific. It's just the game's own UI capabilities.

You can do basic math, If/Else statements, and a few other things that we've figured out collectively along the way :rolleyes:


All times are GMT -5. The time now is 12:41 AM.

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI