CONTROL.INI – WEM | SCRIPT ™ CASE STUDIES


The following is an example of a simple arcade game that can be entirely scripted via the Control.ini and using WEM | Script. Try below to see if you can use the tools in Visual Studio Code and the available WEM | Script command lists to create this experience without the use of our timeline software options:
  • The game begins after a user inserts 3 coins to play (the system must store the number of coins inserted after power cycle).
  • Once the game begins, the user needs to try and press a button as many times as possible to obtain the high score (the system must store high score after power cycle).
  • Throughout game play, the screen will display a countdown timer of the remaining time.
  • When the timer expires, the user is notified of their score and if they have achieved the high score.5. After the game is over, the user is prompted to play again and insert more coins.
Below are two possible examples of how the Control.ini file may look:

Attention! 

During execution there is no complex syntax check. Therefore, we recommend using a code editor, such as VSCode with support for WEM | Script

Only variable conditions can be combined in one line. If you need a combination of several trigger events you have to do this via variables.

 

The content of the Control.ini file looks like this:

Current “Shortest” example – Most efficient INI use code (no start button):

!vcc6=0!mmd255″Please insert 3 coins”#
!i1c!vmc80+1#
!vcc80=3!mmd200:”Start Game”#
!vcc80=3!vcc6=1#
!tm00:01!vcc6=1!vmc1=60#
!t&00:01!vcc6=1!vmc1-1#
!t&00:01!vcc1>0!vcc6=1!mmd100″time remaining=\1″#
!i2c!vcc6=1!vcc1>0!vmc4+1#
!vcc6=1!vcc1=0!mmd200″your score is=\4″#
!vcc6=1!vmc80=0#
!vcc6=1!vcv4>70!vmv70=4#
!t&00:02!vcc6=1!vcc1=0!vcv4>70!mmd200″new high score=\70″#
!t&00:02!vcc6=1!vcc1=0!vcv4<70!mmd200″score to beat=\70″#
!t&00:04!vcc6=1!vcc1=0!vmc6=0#

courtesy Ian Johnson – Animax Designs 

Current “Best” example – Most thorough & state machine with comments  :

//v1 – States (standby; play; end)
//v2 – play score count
//v3 – timer
//v4 – end game timer
//v5 – high score achieved
//v71 – coin count
//v72 – High Score
//**************************************************************
//boot
!tm00:00!vcc71>3!vmc71=0#
!tm00:00!vcc71=3!vmc71=0#
!tm00:00!vcc72>10000!vmc72=0#
!tm00:00!vmc5=0#
!tm00:00!vmc1=0#
//**************************************************************
//Standby
!vcc1=0!mmd255:”Input Coins Inserted: \71″#
!i1o!vcc1=0!vmc71+1#
//if 3rd coin
!i1o!vcc1=0!vcc71=3!vmc3=60# //set game timer to 60
!i1o!vcc1=0!vcc71=3!vmc1=1# //set state to ready to start
//**************************************************************
//Ready to Start
!i1o!vcc1=1!vcc71=3!vmc71=0# //set coins to 0
!i1o!vcc1=1!vcc71>3!vmc71=0# //set coins to 0
!vcc1=1!mmd255:”Press Start When Ready!”# //display ready to start
!i3o!vcc1=1!vmc1=2# //Set state to play
//**************************************************************
//Game play
!i2o!vcc1=2!vmc2+1# //play score count up
!t&00:01!vcc1=2!vmc3-1# //Decrement time
!vcc1=2!vcc3>9!mmd255:”Time: \3 Score: \2″# //Display time
!vcc1=2!vcc3<10!mmd255:”Time: \3 Score: \2″# //Display time
!vcc1=2!vcc3=0!vmc4=10# //Set end game time
!vcc1=2!vcc3=0!vmc1=3# //Go to End Game
//**************************************************************
//End game
!t&00:01!vcc1=3!vmc4-1# //Decrement time
!vcc1=3!vcc4=9!mmd255:”Game End Score: \2″# //Display Game End
!vcc1=3!vcv2>72!vmc5=1# //Set win state
!vcc1=3!vcc5=1!vcc4=5!mmd255:”New High Score!: \2″#
!vcc1=3!vcc5=1!vmv72=2# //Set new high score
!vcc1=3!vcc4=0!vmc1_5=0# //Set state, Score, game time, end time, high score flag to 0
courtesy Geoffrey Bohn – ITEC Entertainment

Now try it yourselves! There are dozens of way to make a similar game ranging from 15 lines to 200+. Let us know if you can beat the current record above and we’ll post your score.