Need help with some scripting

Any idea why this block of code is properly displaying text ingame character menu (this code fragment is responsible for displaying feats on character sheet)


but when I take part of the code above (Feat Collapsable Listbox) and insert it in the place of this one under behavior section:
so code responsible for character behavior looks like this:
everything works just fine but text from strref is not showing up in game anymore? Here is an example:

Second question: Whenever target is selected (friend, npc, enemy or object) we can see it’s model but reversed horizontally. But it is not the case when targeted pc or enemy has set up portrait:
target How to reverse it so it will look like one on the left? Files responsible for targets are named: target_object.xml and target_enemy.xml. The first one is responsible for displaying targeted pc, npc and objects. The second one is resposible only for enemies.

Edit: For the first issue try copying the aling and valign fields for the UItext field header button as well, see if that fixes it. You can also replace strref by typing directly text=“Puppet mode”

The second issue is something you probably can’t overcome, it looks hardcoded to me.

Hi,

I would have thought what you are trying to do would not work at all. But, my XML coding is “wobbly” at the best of times, so it’s just my initial opinion. :wink:

It sounds like you are trying to add the feats list to the final tab on the character sheet (or to the behavior list).

If all you are doing is trying to move the feat list box to that section, then I don’t think it will work at all. Unless you have added extra workaround code not mentioned here.

In your image, where you say, “How it is”, it sounds like you are expecting to see you feats list here. Is that the case? If that is, then the reason it is blank is because you have broken the original XML code, which expects the Puppet Mode string to be there normally.

If I have understood you correctly, the code you added has interfered with the “Puppet Mode” string and your expected result is just absent, due to the code simply not working that way.

I hope that helps. And my apologies if I have misunderstood your post and what you are trying to achieve.

As for your second part… I think you mean reversed on the vertical axis rather than horizontal … yes? :slight_smile:

That said, I think the only way you may be able to achieve anything like you are asking, may be to add extra XML code to display an inverted image over the top of the existing one, which as Clangeddin points out, I also believe to be hard-coded. However, you would have to reproduce all the images that would be required beforehand, even if it was possible, which I don’t think it is at first thoughts.

Cheers, Lance.

Missing part you’ve mention doesn’t solve the problem (it is missing actually because I was trying so many different things for this text to show up and after deleting aling, valign I simply forgot to bring it back:). The text isn’t showing up even if I use text= command. The only logical explanation for me is that something above this code makes it not visible. However you understood what I want to achive here thank you for reply;)

Can you try reverting it to this? Or doesn’t it look how you want it to be?

<!-- Puppet Collapsable -->
<UICollapsable name="BEHAVIOR_DISARM_COL" x=0 y=0 width=PARENT_WIDTH height=PARENT_HEIGHT yPadding=1 xPadding=5 indent=20 isexpanded=true >
	<UIButton name="BEHAVIOR_DISARM_COL_HEADER" strref="183221" header=true x=0 y=0 style="BEHAVIOR_COLLAPSABLE_HEADER" />
	<!-- Puppet On Button -->
	<UIPane name="BEHAVIOR_DISARM_PANE_ON" x=0 y=0 height=32 width=PARENT_WIDTH >
		<UIButton name="BEHAVIOR_PUPPET_STATE_BUTTON_ON" x=0 y=4 style="BEHAVIOR_STATE_BUTTON"
			OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_bhvr_puppet_on","0") />
		<UIButton name="BEHAVIOR_PUPPET_TEXT_BUTTON_ON" strref="181250" x=25 y=0 style="BEHAVIOR_TEXT_BUTTON"
			OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_bhvr_puppet_on","0") />
		<UIButton name="BEHAVIOR_PUPPET_ALL_BUTTON_ON" strref=67445 x=305 y=0 style="BEHAVIOR_ALL_BUTTON" 
			OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_bhvr_a_puppet_on") />
	</UIPane>
	<!-- Puppet Off Button -->
	<UIPane name="BEHAVIOR_DISARM_PANE_ON" x=0 y=0 height=32 width=PARENT_WIDTH >
		<UIButton name="BEHAVIOR_PUPPET_STATE_BUTTON_OFF" x=0 y=4 style="BEHAVIOR_STATE_BUTTON"
			OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_bhvr_puppet_off","0") />
		<UIButton name="BEHAVIOR_PUPPET_TEXT_BUTTON_OFF" strref="181251" x="25" y="0" style="BEHAVIOR_TEXT_BUTTON"
			OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_bhvr_puppet_off","0") />
		<UIButton name="BEHAVIOR_PUPPET_ALL_BUTTON_OFF" strref=67445 x=305 y=0 style="BEHAVIOR_ALL_BUTTON" 
			OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_bhvr_a_puppet_off") />
	</UIPane>
</UICollapsable>

I probably didn’t explained it clearly enough - my fault sorry. No I’m not trying to move feats list to behaviour list! What I want to do is to replace fragment of code taken from feats list which is responsible only for “unfolding” lists and move it to behavior tab which unfolds different well… behaviors. On picture it is only this part where you can see + or - signs. The problem is that what works perfectly well under feats it also work under behavior list but doesn’t display text as is under feat list. If you look at my screenshot “How it is” you can see that this is part which doesn’t display any text (but it should because the same code is originally used in part responsible for feats and this text is visible there.

I don’t know how to explain it more clearly sorry I’m not a dev I’m just trying to mod my interface to be more suited for my monitor :slight_smile:

Hi again,

EDIT: No, I still did not understand what was required. See post further below.

Ah … I understand now… :slight_smile:

Try increasing the height from 22 to 32.

Just for starters.

Cheers, Lance.

Tried it, dosen’t work :wink:

1 Like

EDIT: Misunderstood … See post further below.

Actually, looking at your image, it still looks like your code is not working at all, as the blank spot is the Puppet Mode area. i.e. Your extra bit is not showing at all.

I’ll come back to you again shortly. Just eating dinner.

EDIT: You’ll probably need to place the button inside its own UIPane too.

Why not duplicate the Puppet Mode code and work from there?

i.e. Take a duplication of that code (I think that is what Clangeddin has copied above) and use that duplicated code as a starting point. i.e. You will have two Puppet Mode collapsables.

Cheers, Lance.

This is original code isn’t it? Then this is exactly what I don’t want to have there.
This fragment here

<UICollapsable name="BEHAVIOR_DISARM_COL" x=0 y=0 width=PARENT_WIDTH height=PARENT_HEIGHT yPadding=1 xPadding=5 indent=20 isexpanded=true >
    <UIButton name="BEHAVIOR_DISARM_COL_HEADER" strref="183221" header=true x=0 y=0 style="BEHAVIOR_COLLAPSABLE_HEADER" />

is the only part that I replaced (on screen Replaced part). At the same end where you can see style command this is part responsible for unfolding lists in game. This style named “BEHAVIOR_COLLAPSABLE_HEADER” cannot be modified in any way (at least from this file) and I want to modify it :slight_smile:

I’m sorry but I don’t see the difference in-game from the screenshot you showed, what is visually speaking, that you want to change?

Hi Clangeddin,

EDIT: Misunderstood … See post further below.

I believe they are trying to add another collapsable to the behaviour tab.

So, I recommended just copying the last Puppet Mode section and add it to the top, so that there should be two Puppet Mode sections, which they can now edit the first one as they need to.

I think that’s the objective anyway.

Cheers, Lance.

On screenshot in place where arrow point there is part of UI that “unfolds” list in this case there is On and Off option in this list. The part that + and - is, is what I want to change. You can see that part which is modifed already is thinner and doesn’t have any text by contrast to the ones below it (those are wider and have text which informs what they are for).
Style command in original code already defines it look, shape and what tga files are used there. Code taken from “feats” gives more flexibilty and allows to modify it quite freely.

Hi,

EDIT: OK, actually I think I NOW understand … You are trying to replace the collapsable itself. i.e. Use the Feat version rather than the Behavior version.

In which case, the following can be ignored …

But in your screen shot, the bar you point to is the PUPPET MODE behavior and not anything you added by the looks of it. :slight_smile: However, this bar (Puppet Mode) is not showing any text because the code you add before that looks like it may have broken it. That is how it looks to me.

Did you mean to remove Puppet Mode behavior button?

i.e. Revert back to the original and you will see that there is another option above Follow Distance, which you currently do not display here.

Cheers, Lance.

Ok, solved it, here’s how the header button must look like:

<UIButton name=HeaderButton text="Puppet Mode" x=0 y=0 width=400 height=22 header=true >
	<UIText x=0 y=0 align=center valign=middle fontfamily="Title_Font" style="1" />
	<UIFrame state=up		fill="b_feat_hover_pressed.tga" />
	<UIFrame state=down		fill="b_feat_hover_pressed.tga" />
	<UIFrame state=hilited		fill="b_feat_hover_pressed.tga" />
	<UIFrame state=focused		fill="b_feat_hover_pressed.tga" />
	<UIFrame state=hifocus		fill="b_feat_hover_pressed.tga" />
	<UIFrame state=disabled		fill="b_feat_hover_pressed.tga" />
	<UIFrame state=header		fill="b_feat_normal.tga" />
	<UIFrame state=hiheader		fill="b_feat_normal.tga" />
	<UIFrame state=downheader	fill="b_feat_normal.tga" />
</UIButton>
2 Likes

Thank you very much! Indeed it works:) So you just placed text instead strref command in different place then the original;) Thanks. I would just add that the reason you have 3 options in the list is because you are probably using Tony AI mod which add few of them.

Hi,

Sorry about misunderstanding. It was only when Clangeddin said he did it when I finally understood what you were after. Yes, you simply add text=“xxx” to UIButton object add text here.

You can even change this text via script when you know the name, which you do.

Cheers, Lance.

strref works too btw, I was just too lazy to look up the number.

1 Like

So it isn’t possible to reverse those portraits because it is somehow hardcoded in game engine right? If so topic can be closed. Thank you guys for help.

1 Like

Hi mhroczyn,

I just noticed that these + and - do not change on the behavior. Is that why you were changing it? If so, that is a good idea, and I will do the same if I get the time. :+1:

Cheers, Lance.

Commented line as follows:-

<!UIButton name="BEHAVIOR_DISARM_COL_HEADER" strref="183221" header=true x=0 y=0 style="BEHAVIOR_COLLAPSABLE_HEADER" />

And replaced with:-

			    <UIButton name="BEHAVIOR_DISARM_COL_HEADER" strref="183221" x=0 y=0 width=400 height=22 header=true >
				<UIText x=0 y=0 align=center valign=middle fontfamily="Title_Font" style="1" />
				<UIFrame state=up		fill="b_feat_hover_pressed.tga" />
				<UIFrame state=down		fill="b_feat_hover_pressed.tga" />
				<UIFrame state=hilited		fill="b_feat_hover_pressed.tga" />
				<UIFrame state=focused		fill="b_feat_hover_pressed.tga" />
				<UIFrame state=hifocus		fill="b_feat_hover_pressed.tga" />
				<UIFrame state=disabled		fill="b_feat_hover_pressed.tga" />
				<UIFrame state=header		fill="b_feat_normal.tga" />
				<UIFrame state=hiheader		fill="b_feat_normal.tga" />
				<UIFrame state=downheader	fill="b_feat_normal.tga" />
				</UIButton>

Repeat … for several more lines … observing naming convention and ensuring correct strref used. :slight_smile:

NOTE: I don’t think the XML lines referring to a strref actually matter (at least on some entries), as they appear to be updated outside of the direct XML ref here. So, just make sure you have something that the naming convention knows to update, and make sure the naming convention is right! Eg: Auto Open Locks and Auto Pick Up both use 6818, which relates to Ranged Weapon! I think it may be where BEHAVIOR_DISARM_COL_HEADER is used as a generic name that a strref is important.