OBSE Plugin - MenuQue thread #2

Post » Mon May 10, 2010 1:06 pm

Hmm yes, seems I made a tiny little mistake when downgrading it for v0019. Trying to fix it now. Fixed!

Version 9a
* Now really works with OBSE v19.


And with the new version the Minimap also works as before, thanks Kyoma. :)
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am

Post » Mon May 10, 2010 3:58 pm

I just want to mirror this here. I sent ya a PM about it, but you never read it. (Edit: As soon as I posted, you PM'd me back.. :))

InsertXMLTemplate is causing crashes under WinXP x64. (The same code works fine on Win7 x64)

Faulting module info. (Oblivion.exe)
NTDLL.DLL v5.2.3790.4455 - 0x0001f780

Here is the code in question.

Spoiler

scn guiEffectElementref Item ; Enchantment or Spell - Never an actual item.string_var IDstring_var Effectstring_var Namestring_var IconPathlong Iterlong Countlong EffectCodeBegin Function { Item }	Let Count := GetMagicItemEffectCount Item	While (Iter < Count)		Let Effect := "form_background\effect_window\list_pane"		Let ID := "Effect#"		sv_Replace "#|%0.f", Iter, ID		; Get Effect Name		if (IsNthEffectItemScripted Item Iter)			Let Iter += 1			continue		else			Let Name := GetNthEffectItemName Item Iter		endif		; InsertXMLTemplate - Effect_Template;		PrintC "Effect: %z ID: %z" Effect ID						InsertXMLTemplate "%z|effect_template|%z", Effect, ID, 1011 ; Crashing WinXP x64 - Verified..		; Get Effect Icon		Let EffectCode := GetNthEffectItemCode Item Iter		Let IconPath := GetMagicEffectIconC EffectCode		sv_Insert "Icons\" IconPath		; Setup Effect Values		SetMenuFloatValue "%z\%z\user0", Effect, ID, 1011 Iter		SetMenuStringValue "%z\%z\user1|%z", Effect, ID, IconPath, 1011		SetMenuStringValue "%z\%z\user2|%z", Effect, ID, Name, 1011				Let Iter += 1	Loop	sv_Destruct ID Effect Name IconPathEnd


User avatar
Keeley Stevens
 
Posts: 3398
Joined: Wed Sep 06, 2006 6:04 pm

Post » Mon May 10, 2010 10:06 am

Any news about an Update? :whistling:
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Mon May 10, 2010 1:44 pm

Any news about an Update? :whistling:


This.


And is there any instruction how to add TextEdit to a Menu?
Is it possible to add it to a Vanilla-Menu or do I have to use a Generic-Menu?
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Mon May 10, 2010 8:05 pm

Any news about an Update? :whistling:
Not much news, I've been switching to my own source which will have several benefits but it is taking a bit longer than expected.

And is there any instruction how to add TextEdit to a Menu?
Is it possible to add it to a Vanilla-Menu or do I have to use a Generic-Menu?
Yikes, I see I never finished the Tile Systems article. To anwser your question, yes it is possible to add it to a vanilla menu. Will try and wrap up the article later today.
User avatar
nath
 
Posts: 3463
Joined: Mon Jan 22, 2007 5:34 am

Post » Mon May 10, 2010 2:00 pm

Yikes, I see I never finished the Tile Systems article. To anwser your question, yes it is possible to add it to a vanilla menu. Will try and wrap up the article later today.



Cool, thanks. :)



Edit:
OK, tried out and it works. :)
Never new about this article. Maybe you should link in in the ReadMe/OP. ;)
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Mon May 10, 2010 5:18 am

Forgive me if this is a silly question, but does this tool allow for the creation of new buttons within the game menus? If so, is it now possible to add a "Dispose of Corpse" option?
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Mon May 10, 2010 12:19 pm

It does, but you have to understand a little about the http://cs.elderscrolls.com/constwiki/index.php/Category:Oblivion_XML and "programm" the behaviour clicking the extra button causes (via Script/Menu if possible).
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Mon May 10, 2010 11:38 am

Text Edit is working. :)


Got some problems with SetMenuEventHandler (and a few with the visible-trait of some elements, but I think I can handle that):
Also I register an Event to react to every clicked Button it doesn't react at all. Important lines:
	;I know these are executed	let strEventHandler := LPLSEHOnClickEnchant	SetMenuEventHandler "OnClick", strEventHandler, 1049


scn LPLSEHOnClickEnchant;QuestVar: int LPLSQuVersion.gssLanguageint stiMenuint stiIDref strItemstring_var stsTileBegin Function { stiMenu, stiID, stsTile }	;This line is never called.	dbg_echo "Triggered"End


Any clue what's going wrong here?
User avatar
ImmaTakeYour
 
Posts: 3383
Joined: Mon Sep 03, 2007 12:45 pm

Post » Mon May 10, 2010 9:27 pm

Request about TextEdit:
Is it possible to hide the starting text once TextEdit is activated? And show it again, when TextEdit is closed with an empty string?
It's a bit hard to reopen it when you don't see any text, you know. ;)
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Mon May 10, 2010 6:20 pm

Hey folks, working on a new version of Advanced Magecraft with Axeman, and we have a bit of an issue. We are trying to implement editing enchantments, and so far, it works great. Once. On the second attempt, get a hard crash. What information do you need from me to help troubleshoot this issue?
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Mon May 10, 2010 8:32 pm

Request about TextEdit:
Is it possible to hide the starting text once TextEdit is activated? And show it again, when TextEdit is closed with an empty string?
It's a bit hard to reopen it when you don't see any text, you know. ;)


Check out my mod, it shows you how to do this. (Advanced Magecraft, RenameMenu.xml)

http://www.tesnexus.com/downloads/file.php?id=15587

I experienced issues with "clicking it" too, the solution is to parent the TextEdit menu to something else, like in my case, I used a frame, and made the whole frame clickable, which activates the TextEdit menu. I should clarify, make the TextEdit object, a child of something else. Just look at my XML you should understand.

Also, if it makes sense for your application, just add a default value, my mod demonstrates this too. You can do that from a script, see: my mod again. In fact, just look over how I do lot's of stuff, especially buttons(prefabs folder), Beths button code is awful, seriously, I was in shock for three days trying to decipher that mess. I'm not joking. (Whoever coded that should be in a straight jacket, they are obviously criminally insane.)

Plus, bump for the InsertXMLTemplate issue. (See: HeyYou's post.)
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Mon May 10, 2010 9:17 pm

Thanks, but that's not what I'm looking for. :(
I want the TextEdit-Text to become an empty string, once it's open (and still the default string) and become the default string again when it's closed and an empty string.
I think a SetTextEditText would do the trick.


And for the Button-issue:
Yea, they are quite a mess. Therefore, decided to use my own Buttons. They don't look that great, but they work as expected and I understand how (+ they fit in the rest of the menu).



Oh, and while we're at it: I think our mods might conflict (once mine is finished ;)).
All the Menu-stuff I'm currently working on is to replace the Vanilla-Enchanting system with a skill-based one inspired by the one in Morrowind.
Not much detail about enchanting, but here's the http://www.gamesas.com/index.php?/topic/1111980-wipwipz-lost-skills to my mod.
User avatar
marina
 
Posts: 3401
Joined: Tue Mar 13, 2007 10:02 pm

Post » Mon May 10, 2010 10:08 pm

Thanks, but that's not what I'm looking for. :(
I want the TextEdit-Text to become an empty string, once it's open (and still the default string) and become the default string again when it's closed and an empty string.
I think a SetTextEditText would do the trick.


I don't know what you mean, but if you do it from a script like I suggested, it can be whatever you want. ?

And for the Button-issue:
Yea, they are quite a mess. Therefore, decided to use my own Buttons. They don't look that great, but they work as expected and I understand how (+ they fit in the rest of the menu).


Well, it's up to you, but my code is like a million times simpler than Beths(if you are using their XML)...

Oh, and while we're at it: I think our mods might conflict (once mine is finished ;)).
All the Menu-stuff I'm currently working on is to replace the Vanilla-Enchanting system with a skill-based one inspired by the one in Morrowind.
Not much detail about enchanting, but here's the http://www.gamesas.com/index.php?/topic/1111980-wipwipz-lost-skills to my mod.


No, they won't conflict, mine is all custom, I do access the default enchanting altar, but if you use an event handler to grab the enchanting menu, then they will work fine together. (Though, I don't think very many ppl who use my mod even use that feature, it's basically been deprecated by my custom stuff.)
User avatar
Javier Borjas
 
Posts: 3392
Joined: Tue Nov 13, 2007 6:34 pm

Post » Mon May 10, 2010 4:17 pm

Atlast I have returned! MWUHAHAHAHA.... :D

Seriously, I've been kinda absent the past two weeks but that is hopefully over now. Now..onto the many, many questions.... Unfortunately I'm in the middle of moving/restructuring all of MenuQue's internals and I won't be able to update/fix anything until that is done. Although the main bulk of it is done so I hope it'll go alot faster now. :)

Low Post: Ahh, so you're trying to do that which I too once considered doing. Best of luck. As for buggy menu events, yes, a while ago I discovered that it wasn't working properly more than half the time. Once everything is up and running I'll fix it, or rather, I'll rewrite it. The advantage of it not working at all is that I can rewrite it without having to worry about backwards compatibility. :P

About a TextEditBox, as Claviticus mentioned placing it inside a rect should allow for better activating, even if this rect has no visual aspect. There are a few 'rules' when it comes to a TextEditBox
  • Only one box can be active/typed in at a time. This includes any vanilla boxes the menu may have. There's no limit on the number of boxes per menu though.
  • It is activated when either the text element itself is clicked or its parent element (provided they are visible and can be targeted).
  • Deactivating works pretty much the same only it happens when any element is clicked or the user presses the "Enter" key.
  • It should be possible to use ClickMenuButton to control activation/deactivation through script, I haven't checked though.
  • The text of a box (the trait) can be manipulated through scripting but ONLY while the box is inactive. While it is active any changes made to the trait are ignored/overwritten.
That's most of the stuff, from what I understand it still isn't possible to do what you wish. Maybe through complex, trickery scripting but I think it would be much better (for both of us) if I add such functionality to the TextEdit-System (in the form of a few new traits). And I've also added an OnTextEdit(Done) menu event to avoid the need of constant monitoring to see if the user is still typing or not.

HeyYou and Claviticus: First of, my apologies for not responding to the PMs. Now onto the problems, yes it seems a piece of the code involved with InsertXMLTemplate seems to crash on some (XP) systems. I haven't had a chance to look into it (mostly because of the rewrite) but it will be fixed ofcourse. I expect to narrow it down to an exact line once MenuQue is back in a usable form. When the time comes I'll be needing someone to try out a debug build.... :P

P.S. I've also been doing alot of decoding lately and I found all the info I need for many more quest functions. Things like getting (known) log entries, their dates and text. Very interesting stuff. :)

-kyoma
User avatar
Ernesto Salinas
 
Posts: 3399
Joined: Sat Nov 03, 2007 2:19 pm

Post » Mon May 10, 2010 10:01 pm

Yea, found out about the parent-trait myself. Kinda overread that when I first looked at the tile-page.
Didn't think about script-wize changes to the trait. Since you say (at the Wiki-Page) all changes after the first activation are ignored I thought this also applies to scripts.
Will try that out.
Maybe through complex, trickery scripting but I think it would be much better (for both of us) if I add such functionality to the TextEdit-System (in the form of a few new traits).

Not that complicated. Checking GetTextEditString against the Default Value and an empty string and setting the other if TextEdit started/ended. Nothing more. Could create Problems if the User wants to use the Default string, but that's simply not allowed. :P
But I agree, official support with traits would be better. :)

As for buggy menu events, yes, a while ago I discovered that it wasn't working properly more than half the time. Once everything is up and running I'll fix it, or rather, I'll rewrite it. The advantage of it not working at all is that I can rewrite it without having to worry about backwards compatibility. :P

Solved it with checking against the trait in Menumode. My Script runs anyway, so that's no problem.
Low Post: Ahh, so you're trying to do that which I too once considered doing. Best of luck.

Yes.
It's more complicated then I origianlly thought, but finally I got the Menu up an running (well, almost). The rest should be Scripting stuff.
Selecting the Item, SoulGem, Enchantment, etc. and finally creating the Item.
Not sure if I want to include the increase skill increases Magnitude-stuff Morrowind had. If I do, that's definitely sth. for a Version > 1.0. ;)


PS:
Always good to see someone coming back. If it's you: even better.
:wavey: So welcome back to the halls of insanity. :ahhh:

:teehee:



PS2:
Is it possible to add a http://cs.elderscrolls.com/constwiki/index.php/Operator_Element which uses the value the specified trait had the frame before?
Until now, I always found a way to workaround that problem, but it would have simplified things a lot. ;)



No, they won't conflict, mine is all custom, I do access the default enchanting altar, but if you use an event handler to grab the enchanting menu, then they will work fine together. (Though, I don't think very many ppl who use my mod even use that feature, it's basically been deprecated by my custom stuff.)

I have a MenuMode-Script running and if the Recharge- or Enchant-Menu is displayed I tell the original Menu to be hidden and to show my Menu instead (using InsertXML).
Recharge-Menu has a Button to switch between Enchanting and Recharging.

With conflicts I meant: you have to different systems where some features are the same, but doesn't fit in the other system (e.g. your Scribe-Feature doesn't increase the Enchant-SkillUse).
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Post » Mon May 10, 2010 3:51 pm

Solved it with checking against the trait in Menumode. My Script runs anyway, so that's no problem.
Wait, that worked?!? Are you doing this from a regular script? Last I checked this wasn't very reliable for some menus.

Is it possible to add a http://cs.elderscrolls.com/constwiki/index.php/Operator_Element which uses the value the specified trait had the frame before?
Until now, I always found a way to workaround that problem, but it would have simplified things a lot. ;)
The real problem with this is how the entire XML system works. It does not know 'frames' or get processed on a regular cycle. The whole thing is basically a linked list of traits, expressions and expression refs. When a trait is changed the game checked the expression refs for that trait, determines each trait that uses it in some fashion and then re-evaluates that trait, its expressions and its expression refs. And so forth....

This is also the reason why the example on the wiki page may work in simple cases, for more complex structures it is almost impossible to get it right because the entire trait gets re-evaluated, not just the part that is affected by the changed trait. I'm afraid there isn't much I can do about it. :(
User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Mon May 10, 2010 4:01 pm

Wait, that worked?!? Are you doing this from a regular script? Last I checked this wasn't very reliable for some menus.


Not sure. Never got so far to actually test that. :P
But since I had problems retrieving the correct height-value (calculated trait) I'm afraid it won't work. Although using getmenufloatvalue returned the correct value using it from the console. Maybe I have to use RunScriptLine to make things work.
Will think about it once all the other stuff works.

I'm afraid there isn't much I can do about it. :(


What a pity.
Well, I guess then I'll have to continue using some complicated workarounds. :toughninja:
User avatar
casey macmillan
 
Posts: 3474
Joined: Fri Feb 09, 2007 7:37 pm

Post » Mon May 10, 2010 3:47 pm

When you have the new version ready for testing, feel free to contact me, and I will happily play guinea pig. :D
User avatar
Channing
 
Posts: 3393
Joined: Thu Nov 30, 2006 4:05 pm

Post » Mon May 10, 2010 4:41 pm

Not that complicated. Checking GetTextEditString against the Default Value and an empty string and setting the other if TextEdit started/ended. Nothing more. Could create Problems if the User wants to use the Default string, but that's simply not allowed. :P
But I agree, official support with traits would be better. :)


Got it working using SetMenuStringValue & MenuTapKey 14.
Luckily multiple calls to MenuTapKey in the same frame are treated as single taps (or even more; don't care since I want to delete everything). :)
User avatar
Cathrin Hummel
 
Posts: 3399
Joined: Mon Apr 16, 2007 7:16 pm

Post » Mon May 10, 2010 11:57 am

As for buggy menu events, yes, a while ago I discovered that it wasn't working properly more than half the time. Once everything is up and running I'll fix it, or rather, I'll rewrite it. The advantage of it not working at all is that I can rewrite it without having to worry about backwards compatibility. :P


Uhm, while you're at it, could you implement a possibility to get the full path of the clicked element without specifying a specific id?
Can't use ID's, because this would activate some Vanilla-characteristics which I don't want to use. ;)
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Mon May 10, 2010 7:49 pm

Found a little dirty trick to get access to the clicked-trait:
Use a Dummy-rect (child of the trait you're interested in) wich goes over the complete screen and has this target-trait:
		 1 


In the Script, check for the Mouseover-trait of the Dummy-rect.
Not 100% reliable (has problems if mouse is over other elements of the menu, but with a great depth it about half the time), but at least it works sometimes. ;)
And it doesn't return true, if it's not clicked.
A high depth creates problems with other buttons (because they can't be clicked), so I'd set the depth script-wize only if you're interested in that particular value and reset it afterwards.
[Edit] You have to wait a frame after setting the depth, and best also wait one before resetting it.[/Edit]


Didn't try directly with the example above. Checked against Buttons which change visibility when clicking on them.
As said: sometimes returned, no Button is visible (1 of them always is visible), but never returned the wrong one.


I think that's enough to start working. :)


Edit2:
Got a few Question about mqGetMenuActiveChildIndex:
I guess the index is the number you'd specify using the MenuChild-Functions as whichChild-parameter?
If so, is it possible to get the index of an not-top-level-element (e.g. if you have "background/#element/something" as the active element - with background having several children named element - is it possible to get the index in which element something is)?
And finally: what does the bOverallIndex-Flag do?
User avatar
Taylor Thompson
 
Posts: 3350
Joined: Fri Nov 16, 2007 5:19 am

Post » Mon May 10, 2010 4:51 pm

Is is possible to get a Debug-Mode?
One that tell's you if the trait/child you were trying to set/get a value doesn't exist?
I tend to forget slight changes during C&P and this would help me narrow the problem down. :)


Oh, and for those who are interested: I'm using this file to detect clickes
<_interested> &false; <_x> 0 <_y> 0  &true; <_clicked>							 2 							 1 <_state> 2 <!-- Change to value of <_clicked>: Swap between 1 and 2 --><!-- Check  trait to see if parent was clicked -->			 999 												  	  	  	  

Keeps the value until <_state> is swapped (via Script; 1<-->2), only blocks other elements when <_interested> is true (2) and - from what I can tell right now - works like a charm. :)
<_x> and <_y> are the (total) x/y-coordinates of the parent * -1.
  • If all parents have &false; they can stay 0
  • If your element is centered on the screen they would be
    <_x>			
    2
    <_y>
    2

  • etc.




Edit:
Just tried using Scroll Tile Systems. Another awsome thing working exactly as required. :wub:
Anyway, I find this information is a bit misleading:
This will respond to the mousewheel and increment or decrement the trait.

I first though it'd add/reduce the old value, but it becomes some positive/negative value when scrolling. Perfectly for adding it to the current <_position> trait. :)
Still, not what the description says.
User avatar
Natalie Harvey
 
Posts: 3433
Joined: Fri Aug 18, 2006 12:15 pm

Post » Mon May 10, 2010 9:16 pm

5th post in a row. I'm feeling kind of lonely here. :ahhh:


Anyway, I wondered if it's possible to get any information about which TextEdit is currently open if the Menu has more than one?
Sth. like
(name:string_var) GetLastTextEditInUse

returning the full name like GetActiveUIComponentFullName.


Not sure if I'll need this, but would come in quite handy. :)
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Mon May 10, 2010 9:37 am

For a workaround.... you can only have one open at a time, can't you? How about just setting a switch?
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

PreviousNext

Return to IV - Oblivion