I am sorry…

What this post is about? Pokémon3D, that is. Who would have thought.

Well, we decided to do some restructuring (again), which break most of the scripts and GameModes out there for Pokémon3D, starting with the next version. So you can prepare for the next update, version 0.54, I am going to post the changes we made to the file structure and script system of the game.

Let’s start with the file structure.

We moved all the data that was specific to the Kolben GameMode inside that GameMode folder, and removed those folders from the “Pokemon” root folder. These include most content of the folders “Maps”, “Scripts” and “Content”.

These are the folders in the main Pokémon folder now.

SharedResources contains a few content files that are shared across GameModes and cannot be changed by those GameModes, nor ContentPacks.

Localization contains the legacy token files that will be around until we introduce a new localization system, in about 30 years.

Now, let’s look into the GameModes\Kolben\ folder.

There are some notable changes right from the start. There is a new Data and a new Poke folder. These are the Data folder that has been in the Content folder before, and the Poke folder that was in the Maps folder before.

Also, some data files that we stupidly placed inside the Scripts/Maps folders are now moved into the Data folder:

Hurray, boring stuff.

The Pokemon folder contains all Pokémon data files and the frontier folder, that have been in Content\Pokemon\Data before.

Also, these changes mean one important thing for your GameMode: you cannot access default files anymore with your GameMode. Everything you want to work with, textures, scripts, maps, music, has to be in your GameMode folder.

You can of course copy the files you need from the Kolben GameMode into your GameMode.

Now, let’s talk about Scripts.

I overhauled the entire script system, and I am still working on it. But as of now, these are the changes:

Introducing “Construct”: The next version of Pokémon3D’s V2Script.

Construct is the new name of Pokémon3D’s scripting languages, which is getting an overhaul in the 0.54 version of the game.

We added a lot of new features to the language syntax, as well as the language’s API.

Firstly, these are the syntax changes:



Added an :elseif statement



:elseif:<condition>

A default ElseIf branching option for the :if statement. It works as expected from other languages.

:else only gets selected when :if: and all :elseif:s are not selected.

:endwhen got renamed to :endselect

:endscript got renamed to :exit

@options.show does not open a select block anymore.

The @options.show script command opened a select statement, but without a :select statement, which made the language unclear at this point.

This got removed, and now the :select line is needed.

By default, adding the line “:select:<options.result>” directly below any @options.show statement will make the script work like before.

! comparator and operator

The ! comparator is the opposite of the = comparator.

5!5 returns False

5!1 returns True.

The ! operator can be used to reverse booleanic values, like this:

@text.show(<system.bool(!<battle.won>)>)

returns True if you lost the last battle and False if you won the last battle.

EasyValues

EasyValues are created so make it easier to use variables in Construct.

Instead of using @storage and <storage> to store and retrieve values, EasyValues can be used now.

EasyValues are defined PER SCRIPT INSTANCE, which means that you cannot define a variable in a first script and use it in a second.

This also goes for recursive script calls, if the same script is called from within itself, the values are not the same.

Usage:

Assignment:



<valueName>=somevalue <valueName>=<player.name>

Operations:

Basic math:



<valueName>+=10 <valueName>*=20

String concatenation:



<valueName>&=20

Reading:



@text.show(<valueName>)

EasyValues act like constructs in script commands.

They also don’t need to be explicitly defined, once they get assigned, they exist.

When accessing an EasyValue that has not been assigned, it returns <system.null>.

To pass values over to another script, one can use the arguments in the @script.start call.

This call now takes up to 10 additional arguments, which can be read using <$0> through <$9> in the target script.

Fixed while loop

The while loop can now call nested scripts with @script.start.

\ as escape character

Prior to this version, there was no way to print, for example “<player.name>” on the textbox, because it would get replaced with the player’s name no matter what.

Now, one can use the \ character to escape the construct:



@text.show(\<player.name>)

Removal of “version=2” and “:end”

Scripts no longer need a version declaration at the beginning of the file, they also end automatically when they reach the end of the file.

Removal of the <not> keyword

Because the ! comparator now exists, there was no need for the <not> keyword anymore, so it got removed.

That’s a lot of things, but wait, there’s more!

We also worked on the API and I added/removed/changed a lot of things there as well.

I will link the list here as there’s quite a few things that have been changed. You definitely need to change your scripts and apply these changes if you are working on a GameMode.

Gist link!

If you have any further questions about any of the changes, feel free to create a thread here: http://pokemon3d.net/forum/forums/9/

I will try to answer and reply to all of them, answering your question to the best of my abilities.

Thank you for reading,

- nilllzz

