You are not logged in.
Pages: 1
This object is necessary in scripts develop. I made it for tracking the script execution stages and finding errors. It's a technical object, it displays on the game screen set variables (player position, speed, object position and other values).
Press the W button to show debug information and press this key again to hide it.
_______
scripts\legacy\startup\default_startup.obj
Add string:
object ".default_startup"
{
requires 0.2.0
always_activestate "main"
{
hidecreate_child ".default_startup.opening_animation"
create_child ".default_startup.level_cleared"
create_child ".default_startup.switch_character"
create_child ".default_startup.camera"
create_child ".default_startup.water"
create_child ".DEBUG"
change_state "cooldown"
}
Create file:
scripts\legacy\Debug_Mode.obj
object ".DEBUG"
{
requires 0.2.0
detach_from_camera
always_active
state "main"
{
hide
set_zindex 2.0
set_absolute_position 10 100
on_button_pressed fire5 "show"
}
state "show"
{
hide
set_zindex 2.0
set_absolute_position 10 100
let "$value1 = player_xpos()"
let "$value2 = player_ypos()"
let "$value3 = player_xspeed()"
let "$value4 = player_yspeed()"
let "$value5 = 0" // your variable
let "$value6 = 0"
let "$value7 = 0"
let "$value8 = 0"
let "$value9 = 0"
let "$value10 = 0"textout "hud" 0 0 "player position: $value1 $value2"
textout "hud" 0 10 "player speed: $value3 $value4"
textout "hud" 0 20 "$value5"
textout "hud" 0 30 "$value6"
textout "hud" 0 40 "$value7"
textout "hud" 0 50 "$value8"
textout "hud" 0 60 "$value9"
textout "hud" 0 70 "$value10"on_button_pressed fire5 "main"
}
}
Offline
I had a debug system in Shinobi Densetsu which printed out a few more infos such as player state, current position, internal speed, and did a neat conversion of this speed into real world units (Feet and Meter) based on a 1m/32px scale.
I'll be fixing my old Dropbox links because they're currently broken. Since these objects are universal, here's the code:
object ".player_debug"
{
requires 0.2.0
always_active
detach_from_camera
state "main"
{
create_child ".player_action"
set_zindex 1
change_state "active"
}
state "active"
{
hide
let "$xspd = round(player_xspeed())"
let "$yspd = round(player_yspeed())"
let "$Mps = round (abs($xspd/32))"
let "$Ftps = $Mps*0.3048"
let "$x = round(player_xpos())"
let "$y = round(player_ypos())"
let "$angle = player_angle()"
textout "default" 0 0 "X = $x Y = $y Angle = $angle"
textout "default" 0 16 "Xspd = $xspd Yspd = $yspd M/s = $Mps F/s = $Ftps"
}
}
object ".player_action"
{
requires 0.2.0
always_active
detach_from_camera
state "main"
{
hide
set_zindex 1
on_player_stop "stop"
on_player_walk "walk"
on_player_run "run"
on_player_duck "duck"
if "player_yspeed() < 0" "jump"
on_player_in_the_air "air"
on_player_brake "brake"
on_player_roll "roll"
}
state "stop"
{
textout "default" 0 32 "stopped"
change_state "main"
}
state "walk"
{
textout "default" 0 32 "walking"
change_state "main"
}
state "run"
{
textout "default" 0 32 "running"
change_state "main"
}
state "duck"
{
textout "default" 0 32 "ducking"
change_state "main"
}
state "jump"
{
textout "default" 0 32 "jumping"
change_state "main"
}
state "air"
{
textout "default" 0 32 "in the air"
change_state "main"
}
state "brake"
{
textout "default" 0 32 "braking"
change_state "main"
}
state "roll"
{
textout "default" 0 32 "rolling"
change_state "main"
}
}
https://discord.gg/w8JqM7m ---> Open Surge's Discord server
Offline
Pages: 1