Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
  Latest info can be found on the YaBB Chat and Support Community.
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Scripting : The Clipboard (Read 335 times)
exploreRPG
Administrator
*****
Offline


Explorations Forever!

Posts: 264
Explorations HQ
Gender: male
Scripting : The Clipboard
Feb 14th, 2010 at 8:54am
 
Ev9 contains a series of script commands that enable you to store game related data. This database would be refered to as  "Quest" database. It allows you to save values under a "key" name which can be checked later to see if tasks were completed.

Within Explorations, this feature is called the game clipboard. When my friends and I used to play table-top RPGs, the DM would often sit with his clipboard to take notes about the quest, player actions and behind the scenes events. The clipboard was a reference for how he told the story and presented information. Sometimes helpful, sometimes challenging..

Within Ev9, the clipboard commands are very simple:

Code:
AddClipboard {keyname, data to be saved}
LoadClipboard {keyname}
RemoveClipBoard {keyname}
ClearClipBoard {}


Each data entry into the clipboard is stored under a unique key name, You can load the data entry by this key name. The value will be stored in the SYS_CLIPBOARD$ when retrieved. You can check quest results this way, *WITHOUT* using the sprites Hidden object flags for global events.

Example:

You create a quest which the players are to hunt down and kill the Scorpion King. When the quest starts you execute:

Code:
AddClipboard {scorpionking, alive} 


The above script can also be added to the "On_Init" event of the scorpion kings script record.


On the death of the Scorpion King sprite you can execute the following script. This script can be place within the "On_Killed" event of the Scorpion Kings script record.

Code:
AddClipboard {scorpionking, dead} 



The AddClipBoard will add or update the key value within the clipboard database. If the players attempt to start a new quest before the old one is complete, you can check the status by :

Code:
LoadClipBoard{scorpionking}
If {SYS_CLIPBOARD$ = dead}
   DialogMsg {You have killed the scorpion king, You next quest begins now....}
   -- Create new clipboard keys for the next quest.. and so on.. and so on..
EndIf:{SYS_CLIPBOARD$ = dead}


The clipboard is a simple, yet handy database for storing relative quest data. It should be used as often as you like and should never affect performance when storing values.

Thank you for reading..
Back to top
« Last Edit: Feb 16th, 2010 at 10:08am by exploreRPG »  

The Administrator.
WWW exploreRPG explorerpg@yahoo.com  
IP Logged
 
exploreRPG
Administrator
*****
Offline


Explorations Forever!

Posts: 264
Explorations HQ
Gender: male
Re: Scripting : The Clipboard
Reply #1 - Feb 14th, 2010 at 2:45pm
 
The GetClipBoard command allows you to load a clipboard value into one of your own custom variables. This will allow multiple clipboard values to be loaded to be compared in memory at any given time.

Code:
GetClipBoard{keyname, dest variable} 



The command below will load the status of the scorpion king into the custom variable SCORPION_STATUS$ instead of using the SYS_CLIPBOARD$ variable. Clipboard data can only be read into text ($) variables.

Code:
GetClipBoard {scorpionking, SCORPION_STATUS$} 



To convert text values into numeric script variables, simply use the #variable# syntax. Below is an example.

Code:
AddClipBoard {numberofplayers, 4}
LoadClipBoard {numberofplayers}
SetVal {My_PlayerCount%, #SYS_CLIPBOARD$#}


The value stored in SYS_CLIPBOARD$ will be converted & stored into My_PlayerCount% as a numerical value. This also works for decimal type values.

Code:
AddClipBoard {pi, 3.14}
LoadClipBoard {pi}
SetVal {PiValue!, #SYS_CLIPBOARD$#}


Thanks for reading..
Back to top
« Last Edit: Feb 16th, 2010 at 10:11am by exploreRPG »  

The Administrator.
WWW exploreRPG explorerpg@yahoo.com  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print