Okey New update!
This shows the scripts in action
Some scripts have changed a bit but dont worry i will always release updated documentation of scripts when i release engine
Images:
So far no bugs
Now i can add new script commands easily.
How i made this scripting system may not be the best way but i dont need so complicated one. And this works actually better than many of scripting systems ive seen.. And you can add commands like in other ones
Example how the engine works.
ReadScript()
It will read the strings of a file into array..
ParseScript()
Will go trough all arrays and parse the commands from them..
SearchForCommand()
Will search subcommand from parsed command
RunCheck()
Will search a command from parsed command subcommand
DeleteCommand()
Will delete command buffer
DeleteScript()
Will delete script buffer
But you need to only use ReadScript() and ParseScript(). If you want to change points of reading script file.
SearchForCommand() you need to use if your command uses parms/subcommands.
Use DeleteCommand() if you use SearchForCommand()
RunCheck() and DeleteScript() Works automatically.
Example of command!
Case "[sync on]" `Command Name
If LookForCommand(clrr$)>0 `Search for params
rate=var(command(1)) `command(1) = first param on command.
Sync On rate `Lets put sync on with the rate choosed in script
DeleteCommand() `Delete Command Buffer
Endif
Endcase
That is part of script engine and you can see how easy is to add new command..
If you want to add new commands for subcommands(parms) it will become little harder but you will learn it
Two examples how those actually works.. Non commented tough
Case "[mobid."
com$=GetValue(co$,x)
co$=Replace$(lower$(co$),"[mobid."+com$+"]",com$)
startit=0
Endcase
Case "[mobidname."
com$=GetValue(co$,x)
a=val(com$)
com2$=Mob(a,1).name
co$=Replace$(lower$(co$),"[mobidname."+com$+"]",com2$)
startit=0
Endcase
So i will replace my cutscene editor complicated scripting system with this cuz this scripting system is 100% made by me and i understand it and it feels more better for me.. And isnt bunch of codes.. Actually its 202 lines thats why im kinda proud of it
And variables are really easy to add but i will do that tomorrow. Just remember when you want to use variable you need to use it like this
Var(MyVariable) or if the script command is returning a variable then you can use like this [enemycount-3] or [enemycount-Var(MyVariable)]
Easy
I will add tomorrow the variables and then start doing something else on engine
Hope you understood and like the sound of this
[center]