{ "Flat World", "...", "content_skaterift/maps/dev_flatworld/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_HIDDEN },
{ "Heaven", "...", "content_skaterift/maps/dev_heaven/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_HIDDEN },
{ "Valley", "Cambodia", "content_skaterift/maps/mp_line1/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_VALLEY | ADDON_REG_PREMIUM },
- { "Training Island", "Australia", "content_skaterift/maps/dev_tutorial/addon.inf", ADDON_REG_CAMPAIGN },
- { "Center Island", "Australia", "content_skaterift/maps/dev_hub/addon.inf", ADDON_REG_CAMPAIGN },
- { "Downtown", "USA, Georgia", "content_skaterift/maps/mp_spawn/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_CITY | ADDON_REG_PREMIUM }
+ { "Training Island", "Australia", "content_skaterift/maps/dev_tutorial/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_VOLC },
+ { "Center Island", "Australia", "content_skaterift/maps/dev_hub/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_HUB },
+ { "Downtown", "USA, Georgia", "content_skaterift/maps/mp_spawn/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_CITY | ADDON_REG_PREMIUM },
+ { "Moon", "Venus", "content_skaterift/maps/vm/addon.inf", ADDON_REG_VENUS | ADDON_REG_PREMIUM },
};
for( u32 i=0; i<VG_ARRAY_LEN(maps); i ++ )
kf.s[0] = sca[0]
kf.s[1] = sca[1]
kf.s[2] = sca[2]
-
- print( kf.s[0], kf.s[1], kf.s[2] )
_ms_compiler.keyframes.append(kf)
#}
#define ADDON_REG_INFINITE 0x80
#define ADDON_REG_VALLEY 0x100
+#define ADDON_REG_HUB 0x200
+#define ADDON_REG_VOLC 0x400
#define ADDON_REG_MOUNTED 0x10000
#define ADDON_REG_BROKEN 0x20000
{
if( AF_STR_EQ( &world->meta.af, event->pstr_recieve_event, "interact" ) )
{
+ vg_audio_lock();
+ vg_audio_oneshot( &audio_ui[1], 1.0f, 0.0f, 0, 0 );
+ vg_audio_unlock();
_ent_npc_speech( npc_id, af_str( &world->meta.af, npc->pstr_context_id ) );
return k_entity_event_result_OK;
}
if( AF_STR_EQ( &world->meta.af, event->pstr_recieve_event, "interact" ) )
{
+ vg_audio_lock();
+ vg_audio_oneshot( &audio_ui[1], 1.0f, 0.0f, 0, 0 );
+ vg_audio_unlock();
_ent_npc_speech( npc_id, af_str( &world->meta.af, npc->pstr_context_id ) );
return k_entity_event_result_OK;
}
#include "scripts/tutorial_island.c"
#include "scripts/board_maker.c"
#include "scripts/l1_speed.c"
+#include "scripts/boost.c"
struct ent_script_table_entry _ent_script_table[] =
{
{ "board_maker", _skaterift_script_board_maker },
{ "generic", _skaterift_script_generic },
{ "l1_speed", _script_l1_speed },
+ { "boost", _script_boost },
{ NULL }
};
if( v3_dot( dir, cv ) < 0.0f )
v3_negate( dir, dir );
- f32 s = vg_maxf(0.0f, 1.0f-dist/k_tornado_range),
+ f32 s = vg_clampf(dist/k_tornado_range, 0.0f, 1.0f),
F0 = s*k_tornado_strength,
F1 = s*s*k_tornado_strength;
char exbuf[1024];
u32 l = network_msgstring( chat->msg, msg->m_cbSize, sizeof(netmsg_chat), exbuf, sizeof(exbuf) );
vg_info( "Rcon: %s\n", exbuf );
- vg_execute_console_input( exbuf, 0 );
+ vg_execute_console_input( exbuf, 0, 0 );
}
}
}
{
menu_update_world_filter();
world_map.selected_superworld_locked = 0;
- if( world_map.superworld_list_selected == k_superworld_infinite ) world_map.selected_superworld_locked = 1;
+ if( world_map.superworld_list_selected == k_superworld_infinite )
+ world_map.selected_superworld_locked = 1;
+
if( world_map.superworld_list_selected == k_superworld_venus_moon )
- {
world_map.selected_superworld_locked = !_atom_get( k_atom_list_global, "unlock_venus" );
- }
if( world_map.selected_superworld_locked )
{
}
i32 max_display_count = menu.world_list_nominal_display_count;
- if( max_display_count <= 0 ) max_display_count = 1;
+ if( max_display_count <= 0 )
+ max_display_count = 1;
+
+ bool unlock_mtzero = _atom_get( k_atom_list_global, "unlock_mtzero" ),
+ unlock_city = _atom_get( k_atom_list_global, "unlock_city" ),
+ unlock_valley = _atom_get( k_atom_list_global, "unlock_valley" ),
+ unlock_venus = _atom_get( k_atom_list_global, "unlock_venus" ),
+ completed = _atom_get( k_atom_list_global, "winner" );
u32 page_base = (*selected_world_index / max_display_count) * max_display_count;
for( u32 i=0; i<max_display_count; i ++ )
menu.world_list_whitelist, menu.world_list_blacklist );
VG_ASSERT( addon_id );
addon_reg *reg = addon_details( addon_id );
- bool unlocked = 1;
+
+ u32 flags = 0x00;
+
+ if( reg->flags & ADDON_REG_VOLC )
+ if( unlock_mtzero )
+ flags |= MENU_WORLD_FLAG_DONE;
+
if( reg->flags & ADDON_REG_MTZERO )
- unlocked = _atom_get( k_atom_list_global, "unlock_mtzero" )?1:0;
+ {
+ if( unlock_mtzero )
+ {
+ if( unlock_city )
+ flags |= MENU_WORLD_FLAG_DONE;
+ }
+ else
+ flags |= MENU_WORLD_FLAG_LOCKED;
+ }
+
if( reg->flags & ADDON_REG_CITY )
- unlocked = _atom_get( k_atom_list_global, "unlock_city" )?1:0;
- if( reg->flags & ADDON_REG_VALLEY )
- unlocked = _atom_get( k_atom_list_global, "unlock_valley" )?1:0;
+ {
+ if( unlock_city )
+ {
+ if( unlock_valley )
+ flags |= MENU_WORLD_FLAG_DONE;
+ }
+ else
+ flags |= MENU_WORLD_FLAG_LOCKED;
+ }
- menu.world_list_entries[ menu.world_list_display_count ] = unlocked? addon_id: 0;
+ if( reg->flags & ADDON_REG_VALLEY )
+ {
+ if( unlock_valley )
+ {
+ if( unlock_venus )
+ flags |= MENU_WORLD_FLAG_DONE;
+ }
+ else
+ flags |= MENU_WORLD_FLAG_LOCKED;
+ }
- if( unlocked )
+ if( reg->flags & ADDON_REG_VENUS )
{
- const char *name = NULL;
- vg_msg msg;
- vg_msg_init( &msg, reg->metadata, reg->metadata_len );
+ if( unlock_venus )
+ {
+ if( completed )
+ flags |= MENU_WORLD_FLAG_DONE;
+ }
+ else
+ flags |= MENU_WORLD_FLAG_LOCKED;
+ }
- if( vg_msg_seekframe( &msg, "workshop" ) )
- name = vg_msg_getkvstr( &msg, "title" );
+ if( reg->flags & ADDON_REG_HUB )
+ flags |= MENU_WORLD_FLAG_HUB;
- if( !name )
- name = reg->alias.foldername;
+ const char *name = NULL;
+ vg_msg msg;
+ vg_msg_init( &msg, reg->metadata, reg->metadata_len );
- menu.world_list_names[ menu.world_list_display_count ] = name;
- }
- else
- menu.world_list_names[ menu.world_list_display_count ] = "...";
+ if( vg_msg_seekframe( &msg, "workshop" ) )
+ name = vg_msg_getkvstr( &msg, "title" );
+
+ if( !name )
+ name = reg->alias.foldername;
+
+ menu.world_list_names[ menu.world_list_display_count ] = name;
+ menu.world_list_entries[ menu.world_list_display_count ] = addon_id;
+ menu.world_list_flags[ menu.world_list_display_count ] = flags;
menu.world_list_display_count ++;
}
}
#define MENU_STACK_SIZE 8
#define MENU_WORLD_MAX_COUNT 10
+#define MENU_WORLD_FLAG_HUB 0x1
+#define MENU_WORLD_FLAG_DONE 0x2
+#define MENU_WORLD_FLAG_LOCKED 0x4
+
#include "vg/vg_engine.h"
#include "entity.h"
#include "world_map.h"
addon_id world_list_entries[ MENU_WORLD_MAX_COUNT ];
const char *world_list_names[ MENU_WORLD_MAX_COUNT ];
+ u32 world_list_flags[ MENU_WORLD_MAX_COUNT ];
i32 world_list_display_count,
world_list_total_count,
skaterift_write_viewslot( &sav, "board", k_addon_type_board, localplayer.board_view_slot );
skaterift_write_viewslot( &sav, "playermodel", k_addon_type_player, localplayer.playermodel_view_slot );
- addon_reg *reg = addon_details( _world.main.addon_id );
- if( reg )
- skaterift_write_addon_alias( &sav, "location", ®->alias );
- else
- vg_error( "Tried to reference un-registered world in save file.\n" );
+ if( skaterift.no_save_location == 0 )
+ {
+ addon_reg *reg = addon_details( _world.main.addon_id );
+ if( reg )
+ skaterift_write_addon_alias( &sav, "location", ®->alias );
+ else
+ vg_error( "Tried to reference un-registered world in save file.\n" );
+ }
}
vg_msg_end_frame( &sav );
vg_msg_frame( &sav, "player" );
{
- vg_msg_wkvnum( &sav, "position", k_vg_msg_float|k_vg_msg_32b, 3, localplayer.rb.co );
+ /* 30.05.25: this was changed to 'co' to unfuck existing players from falling through modified worlds etc */
+ //vg_msg_wkvnum( &sav, "position", k_vg_msg_float|k_vg_msg_32b, 3, localplayer.rb.co );
+ vg_msg_wkvnum( &sav, "co", k_vg_msg_float|k_vg_msg_32b, 3, localplayer.rb.co );
}
vg_msg_end_frame( &sav );
--- /dev/null
+static bool _script_boost( ent_script_event *event )
+{
+ if( event->type == k_escript_event_world_event )
+ {
+ struct script_event_world_io *inf = event->info;
+ world_instance *world = &_world.main;
+ if( AF_STR_EQ( &world->meta.af, inf->event->pstr_recieve_event, "boost" ) )
+ {
+ // TODO: Make this dynamiclly fetched from a handler for the entity itself. (or not, fuck you)
+ if( inf->event->flags & k_ent_event_data_const_entity_id )
+ {
+ u32 marker_id = inf->event->data.const_entity_id;
+ if( mdl_entity_id_type( marker_id ) != k_ent_marker )
+ {
+ vg_error( "boost not called with not a marker\n" );
+ return 0;
+ }
+ ent_marker *marker = af_arritm( &world->ent_marker, mdl_entity_id_id(marker_id) );
+
+ v3f fwd = { 0, 1, 0 };
+ q_mulv( marker->transform.q, fwd, fwd );
+
+ v3_muladds( localplayer.rb.v, fwd, skaterift.boost_scale, localplayer.rb.v );
+ }
+ }
+ }
+
+ return 1;
+}
}
}
vg_audio_lock();
- vg_audio_oneshot_3d( &audio_wood_break, where, 100.0f, 1.0f, 0, 0 );
+ vg_audio_oneshot_3d( &audio_wood_break, where, 100.0f, 0.6f, 0, 0 );
vg_audio_unlock();
}
}
player_board_load( &localplayer.fallback_board, "models/board_none.mdl", vg_mem.rtmemory );
}
+int skaterift_quit_command( int argc, const char *argv[] )
+{
+ if( argc >= 1 )
+ if( !strcmp( argv[0], "1" ) )
+ skaterift.no_save_location = 1;
+
+ vg.window_should_close = 1;
+ return 1;
+}
+
static void game_load_co( vg_coroutine *co )
{
if( co_begin( co ) )
vg_loader_step( network_init, network_end );
vg_loader_set_user_information( "Initializing subsystems" );
+ vg_console_reg_cmd( "quit", skaterift_quit_command, NULL );
vg_console_reg_cmd( "load_world", skaterift_load_world_command, NULL );
vg_console_reg_var( "immobile", &localplayer.immobile, k_var_dtype_i32, 0 );
vg_console_reg_var( "allow_resume", &skaterift.allow_replay_resume, k_var_dtype_i32, VG_VAR_CHEAT );
+ vg_console_reg_var( "boost_scale", &skaterift.boost_scale, k_var_dtype_f32, VG_VAR_CHEAT );
vg_loader_step( menu_init, NULL );
vg_loader_step( _user_profile_init, NULL );
vg_loader_step( control_overlay_init, NULL );
u64 full_ready_mask;
const char *override_load_world;
+
+ f32 boost_scale;
+ bool no_save_location;
}
extern skaterift;
ent_ccmd *ccmd = af_arritm( &world->ent_ccmd, mdl_entity_id_id( event->recieve_entity_id ));
const char *cmd_text = af_str( &world->meta.af, ccmd->pstr_command );
vg_info( "ccmd: %s\n", cmd_text );
- vg_execute_console_input( cmd_text, 0 );
+ vg_execute_console_input( cmd_text, 0, 1 );
return k_entity_event_result_OK;
}
else
void world_entity_start( world_instance *world, vg_msg *sav )
{
vg_info( "Start instance %p\n", world );
+ k_gravity = 9.6f;
_event_system.timed_event_count = 0;
for( u32 i=0; i<af_arrcount( &world->ent_event ); i ++ )
vg_msg player_frame = sav;
if( vg_msg_seekframe( &player_frame, "player" ) )
{
- if( vg_msg_getkvvecf( &player_frame, "position", k_vg_msg_v3f, localplayer.rb.co, NULL ) )
+ if( vg_msg_getkvvecf( &player_frame, "co", k_vg_msg_v3f, localplayer.rb.co, NULL ) )
restored_player_position = 1;
}
ctx->font = &vgf_default_title;
ui_rect super_location_box = { back_box[0] - (120+8), back_box[1], 120, 32 };
- ui_text( ctx, super_location_box, "Earth", 1, k_ui_align_middle_center, ui_colour( ctx, k_ui_gray ) );
+ ui_text( ctx, super_location_box, _superworld_names[world_map.superworld_list_selected], 1,
+ k_ui_align_middle_center, ui_colour( ctx, k_ui_gray ) );
if( go_to_super )
{
for( u32 i=0; i<menu.world_list_display_count; i ++ )
{
addon_id addon_id = menu.world_list_entries[i];
- bool clickable = 1;
+ bool clickable = 0;
+
+ const char *name = "...";
- if( addon_id )
+ if( !(menu.world_list_flags[i] & MENU_WORLD_FLAG_LOCKED) )
{
addon_reg *reg = addon_details( addon_id );
bool selected = addon_id == menu.clicked_world_id;
ui_outline( ctx, sel_box, 2, ui_colour(ctx,k_ui_fg), 0 );
}
clickable = !selected;
+ name = menu.world_list_names[i];
}
- else
- clickable = 0;
- if( menu_button( ctx, panel, R == (page_base + i), clickable, menu.world_list_names[i] ) )
+ ui_px tw = 128;
+ ui_rect tickbox = { panel[0]+panel[2]-tw, panel[1], tw, ctx->font->sy*2 };
+
+ if( menu_button( ctx, panel, R == (page_base + i), clickable, name ) )
{
menu.clicked_world_id = addon_id;
menu.clicked_world_name = menu.world_list_names[i];
}
+
+ if( menu.world_list_flags[i] & MENU_WORLD_FLAG_DONE )
+ ui_text( ctx, tickbox, "\xb3\xb3", 1, k_ui_align_middle_center, ui_colour( ctx, k_ui_yellow ) );
+
+ if( menu.world_list_flags[i] & MENU_WORLD_FLAG_HUB )
+ {
+ ctx->font = &vgf_default_small;
+ ui_text( ctx, tickbox, "(hub)", 1, k_ui_align_middle_center, 0 );
+ ctx->font = &vgf_default_large;
+ }
}
if( menu_button( ctx, panel, R == -999, page<max_page, "\x96" ) )