User Tools

Site Tools


scripting:scriptedosd

This is an old revision of the document!


Scripted OSD

Temporary notes:

<codedoc> Event( “Custom”, “SmokeACigar” ) {

  • soundeffect 18

osdcreate(OSDLIST,“Main”,“You just smoked a cigar”)

 osdadditem(OSDTEXT, "", "Do you feel good?") 
 osdadditem(OSDBUTTON, "Option1", "It made me feel good") 
 osdadditem(OSDBUTTON, "Option2", "No. Bleh! I hate cigars!") 
 osdactivate() 

}

Event( “OSDSelect”, “Main:Option1” ) {

 osdcreate(OSDLIST,"Congrats","You feel good?") 
 osdadditem(OSDBUTTON, "Option1", "Yay for the cigar smoker.") 
 osdactivate() 

}

Event( “OSDSELECT”, “Main:Option2” ) {

 osdcreate (OSDLIST,"YOU SUCK!" ) 
 osdadditem(OSDBUTTON, "Option1", "You suck anyway. Click here and get out mah face." ) 
 osdactivate() 

} </codedoc>

the first bit of this lays out the initial menu of the OSD for the use of the cigars. the 'Custom' Event on the start just specifies the event your running for the action, which you want the same identifier as in your CustomEvent identifier was set.

“main” is a label for the parser to identify menu, and the bit after that is a title for the menu.

Each 'osdadditem' line adds a line to the menu for the player to click on to activate. You can name them whatever they want. Option1 and Option2 are just made for example.

OSDTEXT is to put some text above the buttons (or below, depending on where you lay it in the script)

When the player clicks option1 or option2, it kicks an event trigger. when the event trigger for Main:Option1 is set, the event is called, and you can make it do whatever you want that you could normally do in script.

scripting/scriptedosd.1332469144.txt.gz · Last modified: (external edit)