Aller au contenu

Photo

Variables, and a custom and custom Examine XML


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
Jereniva

Jereniva
  • Members
  • 120 messages

Before I get too far in to this, I wanted to ask a question about customizing XML forms.

 

Can I customize the form that opens when you right click and Examine something?

Can it display information pulled from variables stored on the object being examined?

 

In a customized XML form, can I pull data off of the creature being examined, such as list out its feats, or list its inventory, or display local variables stored on it, all in the custom Properties xml form?

 

Regarding variables, is there a limit to how many (how much data) can be stored on the PC object?

Are there problems with storing 100 variables on the PC? 1,000s? Not talking about strings, just integers.

Just curious if I'm going to hit any limits, either technical or performance.

 



#2
Tchos

Tchos
  • Members
  • 5 042 messages

I know from experience that you can modify the examine XML panel like everything else, and Lance Botelle has added NPC information to it for his campaign, perhaps similar to what you have in mind.


  • Jereniva aime ceci

#3
rjshae

rjshae
  • Members
  • 4 485 messages

I think it can handle fairly large variable lists, but I don't know what the limits are. Presumably they use a hash table for variable lookup, or otherwise performance is going to take a definite hit from searching long variable lists. It should be easy enough to test; just try creating a large array with a loop and then do lookups of elements while the game is running.

 

If you need to store large amounts of data for a game, you can always create your own 2da files. The calling routines will cache the data.


  • Jereniva aime ceci

#4
rjshae

rjshae
  • Members
  • 4 485 messages

I have a related question: if the container is an XML file, would it be possible to create a container type with a limited number of slots? (Say 5.)



#5
kevL

kevL
  • Members
  • 4 056 messages
you can print out pretty much anything you like on, say, the Examine sheet.

examine_Duergar_Champion.jpg

it's not easy if you're not used to it, but for example print data about the currently targeted object (which isn't necessarily the object being examined) like range, hitpoints, reputation. This is basically done by giving the .Xml an onUpdate, which calls a script, which resets various GUI elements on the fly.
 
<UIScene ... scriptloadable="true"

<UIPane ...
update="true" updaterate="0.3f" OnUpdate='UIObject_Misc_ExecuteServerScript("gui_updateinfo")'

<UIText name="myINFO_TEXT"...
And the script uses SetGUIObjectText(). It's also possible to pass variables back and forth depending on user input.

variables: There's a limit but it's lots.


@Rj,
I recall trying to set that in a container's blueprint Props. didn't work ...
But some sort of script that checks for quantity of items in the container could probably be hooked up somehow, that removes any excess. Without hardcoded support it doesn't look appealing ....

#6
Dann-J

Dann-J
  • Members
  • 3 161 messages

I've had containers that only accepted one item at a time (in Isle of Shrines), for special ritual sockets where something happens if you insert the right item. From memory, I think the container had an OnInventoryDisturbed script that executed a get first/next loop on the container's inventory, and bounced anything other than the first item back to whoever put it in there. It would be easy enough to modify the concept to count the items while executing the loop, and bounce back anything more than the allowed number of items.



#7
kevL

kevL
  • Members
  • 4 056 messages
fine for chests. what about bags in player's inventory

#8
Dann-J

Dann-J
  • Members
  • 3 161 messages

fine for chests. what about bags in player's inventory

 

Ah - container *items*. They're enough of a headache when it comes to inventory scripts, let alone messing with their XML.