Difference between revisions of "Version 2 Scripts"

From Pokémon 3D Wiki
Jump to navigation Jump to search
Line 170: Line 170:
| None
| None
| Returns the random weather effecting the whole area.<br />Uses the same names as .weather.
| Returns the random weather effecting the whole area.<br />Uses the same names as .weather.
|-
| .weatherid
| None
| Returns the ID of the Weather effecting the current map.<br />Clear=0, Rain=1, Snow=2, Underwater=3, Sunny=4, Fog=5, Sandstorm=6
|-
| .mapweatherid
| None
| Same as .weatherid.
|-
| .currentmapweatherid
| None
| Same as .weatherid.
|-
| .regionweatherid
| None
| Returns the ID of random weather effecting the whole area.<br />Uses the same IDs as .weatherid.
|-
|-
| .canfly
| .canfly

Revision as of 01:34, 15 July 2013

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 to

Commands

Commands always have a subcommand. All combinations will be listed below.

The table is split into sections by Command.

* unless otherwise specified a bool can bee either 1(on) or 0(off).

** Unless otherwise specified X,Y,Z is a three dimensional position.

Subcommand Job Inputs

Battle

Camera

Entity

Environment

Item

Level

Music

NPC

Player

Pokemon

Register

Screen

Script

Sound

Storage

Text

Value

Switches

:if:

:select:

@options.show()

Constructs

Constructs can be used in place of any parameter for command and are used with :if: and :select: statements.
They can even be used in trainer files Constructs always have a subconstruct. All combinations will be listed below.

The table is split into sections by Construct.

* unless otherwise specified a bool can bee either 1(on) or 0(off).

** Unless otherwise specified X,Y,Z is a three dimensional position.

*** Unless otherwise specified bool is either true or false.

Sub-construct Inputs Output

Entity

.additionalvalue(int) int - an Entity ID the contents of the AdditionalValue of the given entity.
.collision(int) int - an Entity ID A bool representing the collision of the given entity.
.opacity(int) int - an Entity ID An int representing the percent see through the given entity is.
.position(int) int - an Entity ID The X,Y,Z position of the given entity.
.scale(int) int - an Entity ID The X,Y,Z scale of the given entity
.Visible(int) int - an Entity ID A bool representing the visibility of the given entity.

@Environment

.daytime None night, morning, day, or evening
.daytimeid None The ID for the time of day.
night=0, morning=1, day=2, or evening=3
.season None winter, spring, summer, or fall
.seasonid None The ID for the season.
winter=0, spring=1, summer=2, or fall=3
.day None Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday
.dayinformation None day,daytime
.week None The current week in the year.
.year None The current year(e.g. 2013)
.weather None Returns the Weather effecting the current map.
Clear, Rain, Snow, Underwater, Sunny, Fog , Sandstorm
.mapweather None Same as .weather.
.currentmapweather None Same as .weather.
.regionweather None Returns the random weather effecting the whole area.
Uses the same names as .weather.
.weatherid None Returns the ID of the Weather effecting the current map.
Clear=0, Rain=1, Snow=2, Underwater=3, Sunny=4, Fog=5, Sandstorm=6
.mapweatherid None Same as .weatherid.
.currentmapweatherid None Same as .weatherid.
.regionweatherid None Returns the ID of random weather effecting the whole area.
Uses the same IDs as .weatherid.
.canfly None A bool representing if the player can fly from the map.
.canteleport None A bool representing if the player can teleport from the map.
.candig None A bool representing if the player can dig from the map.
.wildpokemongrass None A bool representing if the player can find pokemon in the grass on the map.
.wildpokemonwater None A bool representing if the player can find pokemon in the water on the map.
.wildpokemoneverywhere None A bool representing if the player can find pokemon on the map.
.isdark None A bool representing the darkness of the map.

Inventory

.countitem(int) int- Item ID. The ammount of the given item in the bag.
.countitems None The number of Items in the bag.
.name(int) int- Item ID. The name of the given item.

Level

.mapfile None Returns the file path of the current map relative to the maps folder.
.levelfile None Same as .mapfile.
.filename None Reurns the name of the current map file without extension.

NPC

Phone

.callflag None Returns calling if you are calling or receiving if someone is calling you.
.got None A bool representing if the player has received the Phone.

Player

Pokemon

Register

.count None Returns the number of registers.
.registered(str) str - A register string. A bool representing if the string has been registered.

Storage

.count(str) str1 - The type of values to count(integer, string, pokemon, boolean, item).
Does not need to be defined.
Returns the number of different stored values of that type.
If str is not defined then it returns a count of all types.
.get(str1,str2) str1 - The type of value is stored(integer, string, pokemon, boolean, item).
str2 - the name of the stored value.
Returns the value stored as str2.

System

.booltoint(str) Either "true", "false", or a construct that returns one of those. Returns 0 for false and 1 for true.
.calcint(str) An str representing an integer, or a Construct that returns one. Returns the str as an integer.
.calcsng(str) An str representing a single, or a Construct that returns one. Returns the str as a single. (A single is a number that is a decimal)
.dayofyear None Returns the day of the year as an number.
.random(int1,int2) int1 - If it is the only argument then it is the max of the range, other wise it is the min.
int2 - The max of the range. Does not need to be defined.
returns a random integer between the int1 and int2 if both are defined.
If int2 is not defined then it chooses from between 1 and int1.(Ranges are inclusive)
.unixtimestamp None Returns the unit time stamp. (See here for more details.)
.year None Returns the current year.

Value

.get(str) str - The name of the stored value. Returns the value stored as str.