Skip to content

Commit 39dcf49

Browse files
committed
i'm on my breaking point
1 parent 9fc2ca0 commit 39dcf49

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Custom Classes
2+
3+
well it seems like i have no idea how these work myself
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Global Scripts
2+
Global Scripts always run during the game, doesn't matter in which state or where, it always runs. *(runs from when the mod is loaded/game opened up until the game is closed/different mod is loaded)*<br>
3+
You can make one by creating a file in ``./data/`` called ``global.hx``
4+
5+
Global Scripts are useful for certain things, for example, here's the default code in the base's global script:
6+
```hx
7+
function update(elapsed:Float)
8+
if (FlxG.keys.justPressed.F5) FlxG.resetState();
9+
```
10+
Which makes it so that pressing F5 will refresh any state you are currently in.
11+
12+
Or a different example:
13+
```hx
14+
static var cashAmount:Float = 0;
15+
static var playerTitle = "poor";
16+
17+
function update(elapsed:Float) {
18+
if (cashAmount > 1000000) playerTitle = "millionaire";
19+
}
20+
```
21+
This basic example shows how you can use ``static`` variables and trigger actions depending on them. As you can see, these variables are accessible in any script, so you can basically use them in any PlayState Scripts and State Scripts too.
22+
23+
<a href="./Useful script snippets for modders.md">Useful script snippets for modders</a> contains a few useful code snippets that take advantage of Global Scripts.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# NDLL Scripting
2+
3+
neeo fill this page yourself
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Using hxvlc for videos

0 commit comments

Comments
 (0)