From what I understand from the xSimplePanel code, I think this is the SDL you should have:
- Code: Select all
STATEDESC YourAgeNameHere
{
VERSION 1
VAR INT panelButtonsPressed[1] DEFAULT=0
VAR BOOL panelSolved[1] DEFAULT=0
}
... with "panelButtonsPressed" and "panelSolved" the SDL names you give to the Python file.
About how to use SDL files: usually it's not easy to know how to set it up without having a look at how the Python script works. But usually you should be able to guess this way:
You always need the STATEDESC and VERSION things. Usually, whenever you modify the SDL, you increase the number next to VERSION.
Then you need to write the variables the Python script needs in the following way:
- Code: Select all
VAR <type> <name of variable>[<number of elements>] DEFAULT=<default number>
<Name of variable> is obviously the name you enter in the Python's script parameters.
<Default number> is the default value used when the element has never been interacted with. Usually 0=off, 1=on.
<Type> is what the variable should store. If it's an on-off value, you should use BOOL, if it's a small number (between 0 and 255 I believe), you use BYTE, if it's a bigger number, you use INT, and lastly if it's a text message of some kind, you use STRING32. These are the most commonly used values. Also, an INT can replace a BOOL or BYTE value, it's just bigger but works the same. So if you really have no idea what the type is, use INT.
<Number of elements> determine how many values of type <Type> should be stored. You must always set it to 1, except in a very few, rare, cases.
If you don't know which type to use for your SDL variables, the best way is to have a look in existing Age files using the same script.
As for linking this script to xSimpleWarp: do you mean the panel should enable a button which would warp the avatar when clicked ? Or maybe teleport the avatar as soon as the panel is solved ?
In any case, you want to use a third Python script to retrieve the event of the panel being solved, in order to enable or disable physics for the button or region warping the player. It shouldn't be very tricky to setup, the script already exists. It's xAgeSDLBoolRespond.
I never used it, but it should work as follow: the script monitors a SDL variable (panelSolved), if the variable is set to FALSE (not solved), it runs a responder which disables the clickable or region. If it's set to TRUE (solved), it runs another responder which enable the clickable or region.
The script has four other parameters, just leave them at their default value.
I hope this helps you