Make sure to read through the scripting overview and reference pages at
http://theuniversal.net/worldmanual for details of many of the functions and processes involved in the new scripting systems.
coupla wee corrections and additions..
4) You assumption and Morb's answer are correct except that there are now 128 gBuildingVars per building (and 32 gBuildingTimeVars).
5) $var = sysRand(5) actually returns a value from 1 to 5, not 0 to 5.
6) You can trigger a separate event using the 'CustomEvent' function, or by using *event [NAME] [Event_name] or *eventallonline [Event_name].. with the latter triggering the event for everyone currently connected to your world.
You can also add and call your own functions (which gives you the options to pass parameters to the function and return values from it). Using functions is often vital for any complex scripting.
For details on all these things, check out the scripting section in the worldmanual :
http://theuniversal.net/worldmanual/dok ... s_overview
7) These do call an event through which you can intercept the normal GUI behaviour.
When someone selects someone else to barter with the 'BarterRequest' event is triggered. When they select challenge the 'InitChallenge' event is triggered. Once accepted the client handles the GUI for the standard challenges etc, but in both cases they can be interrupted with the 'CancelTransaction()' command.
So if you wanted to implement your own barter system you'd script something like..
Code: Select all
Event( "BarterRequest", "" )
{
// Cancel the standard barter system
CancelTransaction()
// Trigger events for both players to do your own thang
*event %PLAYER% MyCustomBarterOSD
*event %TARGET% MyCustomBarterTargetOSD
}
Its on the list to add a configurable option to the player targetting menu so you can add a button with a custom name and receive an event when its used.