Difference between revisions of "Scripts"

From Pokémon 3D Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
The scripts folder contains all of the scripts for in-game events. It also contains the Trainer files and the files for the world maps.
Starting with version 0.32 a second scripting language known as version=2 was implemented into the game. Starting with version 0.33 all new scripts for the main game are made in version=2 scripts.  
Starting with version 0.32 a second scripting language known as version=2 was implemented into the game. Starting with version 0.33 all new scripts for the main game are made in version=2 scripts.  


Line 13: Line 15:
Commands are written as @command.subcommand and are no longer case sensitive. All commands require a subcommand.
Commands are written as @command.subcommand and are no longer case sensitive. All commands require a subcommand.


Constructs were also expanded to be <construct.subconstruct> and can be used with switches to
Constructs were also expanded to be <construct.subconstruct> and can be used with switches too


There are numerous scripts that can be used withing the Pokemon 3D game.
There are numerous scripts that can be used withing the Pokemon 3D game.
Line 21: Line 23:
There are 2 types of trainer files, one that is less descriptive and one that is more.
There are 2 types of trainer files, one that is less descriptive and one that is more.


== Constructs ==
== [[World Map]] ==
Constructs are functions in scripts that are not doing something in the game but rather with the script itself.
World map files are stored in the /Scripts/worldmap/ folder and are named for the region the represent.
Constructs start with a : at the beginning of the line and are case sensitive!
Here's the list of constructs:
 
{|class="wikitable"
! Construct
! Use
|-
| :end
| Ends the script.
|-
| :endif
| Ends an :if statement.
|-
| :endwhen
| Ends a when statement
|-
| :if
| See Below.
|-
| :then
| Follows an :if statement. Continues here if true.
|-
| :else
| Continues here when an :if statement if False.
|-
| :when
| Works as a switch for the @options command.
|}
 
=== :if statements ===
:if statements can be either 'if true' statements or 'if false' statements
 
'if true:'
<pre>:if:register(elm1)</pre>


'if false'
As part of the header for a map file the {"CurrentRegion"{str[regionname]}} is listed which dictates which map is looked at when viewing the town map or when flying.
<pre>:if:not register(elm1)</pre>


:if statements can take a variety of conditions as the argument. Here is the full list.
This feature was implemented in version 0.3 along with [[Fly]].


{|class="wikitable"
{{FilePaths}}
! Argument
! Variable
! Description
|-
| :aurora
| no variable
| Checks for the 'Aurora' effect?
|-
| :day(#)
| # - A 'day' code. (0-6) 0 = Sunday and goes from there.
| Checks if the current weekday matches the code given.
|-
| :daytime(#)
| # - A time of day value. 0 = night, 1 = morning, 2 = Day, 3 = Evening.
| Checks the time of day against the given value.
|-
| :freeplaceinparty
| no variable
| Checks to see if your party is full.
|-
| :hasBadge(#)
| # - the number of a gym badge. Remember Brock = 1, Falkner = 9.
| Checks if you have the given badge.
|-
| :hasItem(#)
| # - [[Items|An Item's ID number.]]
| Checks if the given item is in your bag
|-
| :nopokemon
| No variable
| Checks to see if you have any Pokemon.
|-
| :position(#,X,Y,Z)
|
* # - The NPC ID of an NPC on the Map. Can also be 'Player' to check the player's position
* X,Y,Z - A three coordinate position.
| Checks if the given NPC(or the player) is in the given place
|-
| :random(#)
| # - The max value.
| Produces a Random integer?
|-
| :regionWeather(#)
| # - A weather ID. 0 = Clear, 1 = Rain, 2 = Snow, 3 = Bubbles
| Checks to see if the random weather is the same as the given weather.
|-
| :register(text)
| text - A register value in the register.dat file of the save folder.
| Checks to see if the 'text' is in the register.dat file. Considered true if found.
|-
| :weather(#)
| # - A weather ID. 0 = Clear, 1 = Rain, 2 = Snow, 3 = Bubbles
| Checks the map weather against the given weather. This is not the random weather effect but rather permanent weather such as Route 33's eternal rain.
|}

Latest revision as of 06:36, 7 September 2014

The scripts folder contains all of the scripts for in-game events. It also contains the Trainer files and the files for the world maps.

Starting with version 0.32 a second scripting language known as version=2 was implemented into the game. Starting with version 0.33 all new scripts for the main game are made in version=2 scripts.

Version 1 Scripts

These scripts follow the @Command:subcommand pattern with not all Commands needing sub commands.

Version 1 is Case Sensitive.

These scripts are still supported but are not used by the dev team when making new scripts.

Version 2 Scripts

Version 2 scripts were started in version 0.32. Any script in Version 2 must have "version=2" as the first line of the script.

Commands are written as @command.subcommand and are no longer case sensitive. All commands require a subcommand.

Constructs were also expanded to be <construct.subconstruct> and can be used with switches too

There are numerous scripts that can be used withing the Pokemon 3D game.

Trainer Files

Trainer files all have the extension .trainer. There are 2 types of trainer files, one that is less descriptive and one that is more.

World Map

World map files are stored in the /Scripts/worldmap/ folder and are named for the region the represent.

As part of the header for a map file the {"CurrentRegion"{str[regionname]}} is listed which dictates which map is looked at when viewing the town map or when flying.

This feature was implemented in version 0.3 along with Fly.

Game Folder
Content ContentPacks GameModes Saves Screenshots Game Executable
Pokemon Data ContentPack Folder GameMode folder Savegame folder Version History
Data Maps Moves Items Scripts Control Files Content GameMode.dat Party.dat Player.dat Options.dat
poke battle structures V1 V2 trainer worldmap