Aller au contenu

Photo

DisplayGuiScreen with built-in GUI screens


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

#1
MasterChanger

MasterChanger
  • Members
  • 686 messages
For some reason I haven't been able to retrieve or affect the default GUI screens through scripts. I've tried this for various screens listed in ingamegui.ini with no luck.

For example:
    DisplayGuiScreen(oPC, "SCREEN_AREAMAP", FALSE);
doesn't seem to do anything for me, and I'm not sure why (I've verified that the script in question is running).

I've successfully used DisplayGuiScreen, SetGUIObjectText, and SetGUITexture on GUIs that I've defined through my own .xml files, but I can't get it to work for the built-in ones. Any help?

Modifié par MasterChanger, 19 novembre 2010 - 10:41 .


#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Try adding in the string sFileName parameter. I know that the function explaination in Script Assist says you don't need to with default GUIs, but SA has been wrong before. Try adding in the parameter and see if it works then.

#3
MasterChanger

MasterChanger
  • Members
  • 686 messages
Thanks _KM_, I tried that. No dice.

I also, just out of curiosity, tried displaying those GUIs by using a different name for the screen (second parameter) and directly referencing the .xml file. For example,

DisplayGuiScreen(oPC, "areamap1", FALSE, "areamap.xml");

but that didn't work either.

Modifié par MasterChanger, 19 novembre 2010 - 01:50 .


#4
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
You may need to edit the XML file and give it the setting of scriptloadable = true, otherwise it can not be called from script. You would then need to distribute this (as part of a hak or whatever) to your players.

#5
0100010

0100010
  • Members
  • 87 messages
KM is correct. All GUI screens which can be invoked by script must have the scriptloadable=true setting in their main root node. Find some existing ones to see how they were done.

#6
MasterChanger

MasterChanger
  • Members
  • 686 messages
Well, I'll be damnèd! I could have sworn I'd checked that the scenes in question were script-loadable but vainly - vainly! - would I have sworn, it seems.

So I can now get the GUIs to show if I create an override copy with scriptloadable=true. What I'm working on, in case anyone's curious, is a system for partially obscuring the area map with a translucent overlay. There are already some tricks for either disabling the map entirely or obscuring the terrain entirely by placing a tileblock way up in the sky, stretched to cover the whole area, but I want somethiing more subtle. I have a script called OnAdd for the map that will check for a local string on the area of an image file to use as an overlay.

Right now I seem to have an issue that the alpha (translucency) of the image will work fine if the image is specified in the .xml, but if I use SetGUITexture the alpha setting in the .xml seems to be ignored. This might have to be handled by finagling the image a bit.

Thanks _KM_ and Binary, and thanks again to Lance B for his excellent XML tutorial!

#7
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
NP. Please keep us updated on your progress. I know that many people would be interested in this, I certainly am!

#8
0100010

0100010
  • Members
  • 87 messages
Here is a crazy thought.



Fog of war.



How to acheive?



Create your overaly in the form of a grid of black squares (the smaller the more fine the unit of division)



Create some table array of entries that flag that state of each black square in the grid as being visible (unexplored) or not visible (explored)



Use custom heartbeat scripts in your area to mathematically calcualte the PCs current position on the map and translate that into the nearest grid tile and flip the bit state of that square.



You now have active fog of war on the UI map.






#9
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Isn't that what he suggested?

#10
MasterChanger

MasterChanger
  • Members
  • 686 messages
No, I wasn't talking about an active fog of war that covers certain terrain based on player position. That might be a reasonable project for single-player campaigns, and I would certainly applaud anyone who did that.

I'm working on this primarily for PW use, however (if SP authors want to use it that's great) so I don't want to continually mess with the map of each individual player too terribly much, and I hesitate to burden area HB's that heavily.

#11
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
It would be a gui heartbeat actually. Pretty easy to implement too. ( no real issues either, most difficult is turning off the client extension as well, but i've already worked that out with skywing ).

#12
MasterChanger

MasterChanger
  • Members
  • 686 messages

painofdungeoneternal wrote...

It would be a gui heartbeat actually. Pretty easy to implement too. ( no real issues either, most difficult is turning off the client extension as well, but i've already worked that out with skywing ).


A GUI heartbeat? Wow, tell me more! I didn't know that such a thing was possible. How do you access events for a GUI?