Skip to content

Instantly share code, notes, and snippets.

View dusttrackerpro.cpp
class script {
scene@ g;
textfield@ txt;
int init_filth;
int init_filth_block;
int init_enemy;
script() {
@g = get_scene();
@msg555
msg555 / sounddemo.cpp
Created Oct 20, 2017
An example of how to embed and use custom sounds with dustscripting.
View sounddemo.cpp
const string EMBED_sound1 = "test1.ogg";
class script {
scene@ g;
script() {
@g = get_scene();
}
void build_sounds(message@ msg) {
@msg555
msg555 / sprite_example.cpp
Last active Oct 12, 2017
An example of how to embed, build, and use custom sprites with dustscripts.
View sprite_example.cpp
const string EMBED_test1 = "test1.png";
const string EMBED_test2 = "test2.png";
class script {
int frame_count;
sprites@ spr;
script() {
frame_count = 0;
@spr = create_sprites();
View triggertest.cpp
class script {
scene@ g;
int frame;
script() {
@g = get_scene();
frame = 0;
}
void step(int entities) {
@msg555
msg555 / audio.txt
Created Aug 4, 2017
Audio names in DF
View audio.txt
All Stream Names
amb_birds
amb_hollow
amb_city
amb_crickets
amb_wind
amb_machinery
amb_computers
amb_rain
View hittest.cpp
const int MAX_PLAYERS = 4;
class script {
scene@ g;
array<controllable@> players;
script() {
@g = get_scene();
players.resize(MAX_PLAYERS);
}
@msg555
msg555 / aitest.cpp
Created Jul 29, 2017
Create and setup an AI controller
View aitest.cpp
class script {
bool firstFrame;
script() {
firstFrame = true;
}
void step(int entities) {
if (!firstFrame) {
return;
@msg555
msg555 / sample.cpp
Created Jul 28, 2017
Restore air charges when player collects dust
View sample.cpp
const int MAX_PLAYERS = 4;
class script {
/* We don't actually use the scene object in this script, but most will. */
scene@ g;
/* Keep track of how much dust we had in the last frame. */
array<int> dust_last;
/* Keep track of how much dust we had when the last checkpoint was saved. */
@msg555
msg555 / proptest.cpp
Created Jul 28, 2017
Create a prop and move it 1 unit per frame.
View proptest.cpp
class script {
/* We don't actually use the scene object in this script, but most will. */
scene@ g;
prop@ p;
int frame;
int frame_cp;
script() {
@g = get_scene();
@msg555
msg555 / entities.txt
Last active Jul 28, 2017
List of Dustforce entities
View entities.txt
AI_controller
ambience_trigger
camera_node
check_point
dust_girl
dust_kid
dust_man
dustmod_entity_tool
dust_worth
dust_wraith
You can’t perform that action at this time.