little bit of this little bit of that
authorhgn <hgodden00@gmail.com>
Tue, 27 May 2025 20:17:16 +0000 (21:17 +0100)
committerhgn <hgodden00@gmail.com>
Tue, 27 May 2025 20:17:16 +0000 (21:17 +0100)
29 files changed:
content_skaterift/maps/dev_heaven/main.mdl
content_skaterift/maps/dev_hub/main.mdl
content_skaterift/maps/dev_tutorial/main.mdl
content_skaterift/maps/mp_mtzero/before.mdl
content_skaterift/maps/mp_mtzero/main.mdl
content_skaterift/metascenes/ch2s3a.ms
content_skaterift/metascenes/ch2s4.ms
content_skaterift/metascenes/ch2s4FUCK.ms [new file with mode: 0644]
content_skaterift/metascenes/ch2s4a.ms
content_skaterift/metascenes/ch4s1a.ms
content_skaterift/models/lazes.mdl [new file with mode: 0644]
skaterift_blender/sr_main.py
skaterift_blender/sr_mdl.py
skaterift_blender/sr_metascene.py
src/compass.c
src/ent_challenge.c
src/ent_npc.c
src/ent_region.c
src/ent_region.h
src/ent_script.c
src/entity.h
src/gui.h
src/metascene.c
src/metascene.h
src/player_skate.c
src/scripts/generic.c
src/world_entity.c
src/world_load.c
src/world_routes.c

index 90318def519d4934be8e98846e367d28e54fddf4..320860bb75e360ad676213ca763b08517ceb50d8 100644 (file)
Binary files a/content_skaterift/maps/dev_heaven/main.mdl and b/content_skaterift/maps/dev_heaven/main.mdl differ
index ac093da7d5f6bc1e09223170455560beadfd5d88..ad7c362c6304e52651f968328fa099999da8c226 100644 (file)
Binary files a/content_skaterift/maps/dev_hub/main.mdl and b/content_skaterift/maps/dev_hub/main.mdl differ
index adb1b874d177d782d41b638d38357d32bdeaaeb9..5ffb99f4c9dbef40cfdefe359078cca420269a20 100644 (file)
Binary files a/content_skaterift/maps/dev_tutorial/main.mdl and b/content_skaterift/maps/dev_tutorial/main.mdl differ
index ed66d46ab8206cc6483529c09b1aa5f915b9c47b..e000c27c07d71563cb7989ae4561babaec6a63b7 100644 (file)
Binary files a/content_skaterift/maps/mp_mtzero/before.mdl and b/content_skaterift/maps/mp_mtzero/before.mdl differ
index 2d4686c459de687363182f1f844a4140df6ab68b..03637628653606d83b0e260ca06a48cc46ce16e0 100644 (file)
Binary files a/content_skaterift/maps/mp_mtzero/main.mdl and b/content_skaterift/maps/mp_mtzero/main.mdl differ
index 89867e0fa877126f0581662462890e1cce10434f..a1b36468aed863f87d2c2b54592ae7644f83545f 100644 (file)
Binary files a/content_skaterift/metascenes/ch2s3a.ms and b/content_skaterift/metascenes/ch2s3a.ms differ
index 34aef21e0c172620534108f496ec45c85994e55c..472a39be49cc09cba6798c8eada9cf650e5a7a7e 100644 (file)
Binary files a/content_skaterift/metascenes/ch2s4.ms and b/content_skaterift/metascenes/ch2s4.ms differ
diff --git a/content_skaterift/metascenes/ch2s4FUCK.ms b/content_skaterift/metascenes/ch2s4FUCK.ms
new file mode 100644 (file)
index 0000000..385ad49
Binary files /dev/null and b/content_skaterift/metascenes/ch2s4FUCK.ms differ
index e428f7c49ca4f5b883cc320b19aa8993ce292387..6b75a7eb90438c72130983e0b0fda60b7b10eb3e 100644 (file)
Binary files a/content_skaterift/metascenes/ch2s4a.ms and b/content_skaterift/metascenes/ch2s4a.ms differ
index 6535ee8cf2a9a6d684915d3dcea7ed35c683332a..a330c27ab18df5e2a168029b7cc1836a5713d444 100644 (file)
Binary files a/content_skaterift/metascenes/ch4s1a.ms and b/content_skaterift/metascenes/ch4s1a.ms differ
diff --git a/content_skaterift/models/lazes.mdl b/content_skaterift/models/lazes.mdl
new file mode 100644 (file)
index 0000000..f465ff0
Binary files /dev/null and b/content_skaterift/models/lazes.mdl differ
index ba854e56f7b8538fb0750ffcf4ee542a1545107b..8af6c51e99ab5de83a7f0a333e7f5fae845cecef 100644 (file)
@@ -330,7 +330,9 @@ class ent_npc(Structure):
 #{
    _fields_ = [("transform",mdl_transform),
                ("pstr_id",c_uint32),
-               ("pstr_context_id",c_uint32)]
+               ("pstr_context_id",c_uint32),
+               ("pstr_anim",c_uint32),
+               ("none0",c_uint32)]
    sr_functions = { 'proximity': 0x00, 'interact': 0x00 }
 #}
 
@@ -1774,6 +1776,7 @@ class SR_OBJECT_ENT_GLIDER(bpy.types.PropertyGroup):#{
 class SR_OBJECT_ENT_NPC(bpy.types.PropertyGroup):#{
    id: bpy.props.StringProperty()
    context_id: bpy.props.StringProperty()
+   anim: bpy.props.StringProperty()
 
    # old, unused.
    # au: bpy.props.IntProperty()
@@ -3169,13 +3172,18 @@ def cv_draw_route( route, dij ):
       gi = checkpoints[i].target
       gj = checkpoints[(i+1)%len(checkpoints)].target
 
+      cc1 = cc
+      if bpy.context.active_object == route:
+         if route.SR_data.ent_route[0].gates_index == i:
+            cc1 = (1,1,1)
+
       if gi:
       #{
          if gi.SR_data.ent_gate[0].tipo != 'passive':
          #{
             dest = gi.SR_data.ent_gate[0].target
             if dest:
-               cv_draw_line_dotted( gi.location, dest.location, cc )
+               cv_draw_line_dotted( gi.location, dest.location, cc1 )
             gi = dest
          #}
       #}
@@ -3187,19 +3195,18 @@ def cv_draw_route( route, dij ):
 
       if path:
       #{
-         cv_draw_arrow(gi.location,dij.points[path[0]],cc,1.5,False)
-         cv_draw_arrow(dij.points[path[len(path)-1]],gj.location,cc,1.5,False)
+         cv_draw_arrow(gi.location,dij.points[path[0]],cc1,1.5,False)
+         cv_draw_arrow(dij.points[path[len(path)-1]],gj.location,cc1,1.5,False)
          for j in range(len(path)-1):#{
             i0 = path[j]
             i1 = path[j+1]
             o0 = dij.points[ i0 ]
             o1 = dij.points[ i1 ]
-            cv_draw_arrow(o0,o1,cc,1.5,False)
+            cv_draw_arrow(o0,o1,cc1,1.5,False)
          #}
       #}
-      else:#{
-         cv_draw_line_dotted( gi.location, gj.location, cc )
-      #}
+      else:
+         cv_draw_line_dotted( gi.location, gj.location, cc1 )
    #}
 #}
 
index dfa767167d86f01a1c50c392acd06dab5180597c..9b35d22c704146297681440757c2f975b69ad3fb 100644 (file)
@@ -937,7 +937,8 @@ def _mdl_compiler_compile_entities():
             npc = ent_npc()
             compile_obj_transform( obj, npc.transform )
             npc.pstr_id = _af_pack_string( obj_data.id )
-            npc.pstr_context_id =  _af_pack_string( obj_data.context_id )
+            npc.pstr_context_id = _af_pack_string( obj_data.context_id )
+            npc.pstr_anim = _af_pack_string( obj_data.anim )
             sr_ent_push( npc )
          #}
          elif ent_type == 'ent_script':#{
index b28fc62045c2f900a481c16a34b30cacd776165c..ad034301f00edc4b87eb8b44a6d6dd895b192e50 100644 (file)
@@ -105,7 +105,7 @@ class ms_strip_data_union(Union):
 class ms_strip(Structure):
 #{
    _fields_ = [("mode",c_uint8),
-               ("offset",c_uint32),
+               ("offset",c_int32),
                ("anon",ms_strip_data_union)]
 #}
 
@@ -257,8 +257,10 @@ def _metascene_comp_armature_range( obj, start, end, out_strip ):
          kf.q[2]  = -rq[2]
          kf.q[3]  =  rq[0]
          kf.s[0]  = sca[0]
-         kf.s[1]  = sca[2]
-         kf.s[2]  = sca[1]
+         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)
       #}
@@ -462,7 +464,7 @@ def _metascene_camera_anims( obj, entity_id ):
             _metascene_compile_action_curves( out_strip, NLAStrip.action )
             out_strip.anon.strip.instance_id = 0xffffffff
             out_strip.anon.strip.object_id = entity_id
-            out_strip.anon.strip.offset = math.floor( NLAStrip.frame_start )
+            out_strip.offset = math.floor( NLAStrip.frame_start )
             out_strip.anon.strip.timing_offset = NLAStrip.action_frame_start
             out_strip.anon.strip.length = math.ceil( NLAStrip.frame_end - out_strip.offset )
             out_strip.anon.strip.pstr_name = _af_pack_string( NLAStrip.name )
@@ -483,7 +485,7 @@ def _metascene_camera_anims( obj, entity_id ):
             _metascene_compile_action_curves( out_strip, NLAStrip.action )
             out_strip.anon.strip.instance_id = 0xffffffff
             out_strip.anon.strip.object_id = entity_id
-            out_strip.anon.strip.offset = math.floor( NLAStrip.frame_start )
+            out_strip.offset = math.floor( NLAStrip.frame_start )
             out_strip.anon.strip.timing_offset = NLAStrip.action_frame_start
             out_strip.anon.strip.length = math.ceil( NLAStrip.frame_end - out_strip.offset )
             out_strip.anon.strip.pstr_name = _af_pack_string( NLAStrip.name )
index 7a651ee84c674f4b63bcebdcc77e2ad00cc74b22..7dd9fd3787bffa47ce166dd24c7369be7b57827b 100644 (file)
@@ -163,12 +163,6 @@ void compass_render_texture(void)
       {
          ent_route *route = af_arritm( &world->ent_route, i );
 
-         if( !(route->flags & (k_ent_route_flag_achieve_gold|k_ent_route_flag_achieve_silver)) )
-         {
-            if( compass_co( projection, route->board_transform[3], 0.0f ) )
-               mdl_draw_submesh( &mdl->submeshes[ _compass.sm_comp_objective ] );
-         }
-
          if( route->active_checkpoint != 0xffff )
          {
             v4f colour;
@@ -189,6 +183,19 @@ void compass_render_texture(void)
          }
       }
    }
+   else
+   {
+      shader_compass_uColour( (v4f){ 1,1,1,1 } );
+      for( u32 i=0; i<af_arrcount(&world->ent_route); i++ )
+      {
+         ent_route *route = af_arritm( &world->ent_route, i );
+         if( !(route->flags & (k_ent_route_flag_achieve_gold|k_ent_route_flag_achieve_silver)) )
+         {
+            if( compass_co( projection, route->board_transform[3], 0.0f ) )
+               mdl_draw_submesh( &mdl->submeshes[ _compass.sm_comp_objective ] );
+         }
+      }
+   }
 }
 
 void compass_render_imgui( ui_context *ctx )
index cc4599f6c7da1e81ee3280aa4f88fd664f292732..d925f6525a55c24381e8e704274aadb5a02112e8 100644 (file)
@@ -25,9 +25,15 @@ void _ent_challenge_win(void)
 
    world_instance *world = &_world.main;
    ent_challenge *challenge = af_arritm( &world->ent_challenge, mdl_entity_id_id( _world.active_challenge_id ) );
+
+   if( !challenge->status )
+   {
+      gui_notify( "\xb3 Challenge complete!", 5.0f, k_ui_fg );
+   }
+
    _ent_challenge_clear( challenge );
    challenge->status = 1;
-   ent_region_re_eval( world );
+   ent_region_re_eval( world, 0 );
 
    struct ent_script_event event;
    struct script_event_completion_changed inf = {
@@ -333,7 +339,7 @@ static int _skaterift_challenge_ccmd( int argc, const char *argv[] )
          if( argc==2 )
          {
             challenge->status = atoi( argv[1] );
-            ent_region_re_eval( world );
+            ent_region_re_eval( world, 0 );
             
             struct ent_script_event event;
             struct script_event_completion_changed inf = {
@@ -365,7 +371,7 @@ static int _skaterift_challenge_ccmd( int argc, const char *argv[] )
                route->flags |= (u32)(k_ent_route_flag_achieve_silver);
             if( !strcmp( argv[1], "gold" ) )
                route->flags |= (u32)(k_ent_route_flag_achieve_gold|k_ent_route_flag_achieve_silver);
-            ent_region_re_eval( world );
+            ent_region_re_eval( world, 0 );
 
             struct ent_script_event event;
             struct script_event_completion_changed inf = {
index 1b71ab28ac988e1d2a7cf4ab31473ad4a770b85e..12c16b5fd40750f58cee9301a58376843d80409c 100644 (file)
@@ -30,10 +30,18 @@ struct
       struct player_effects_data effect_data;
       player_pose pose;
       m4x3f *final_mtx;
+
+      enum
+      {
+         k_npc_idle,
+         k_npc_stand,
+         k_npc_sit
+      }
+      anim;
    }
    humans[4];
 
-   struct skeleton_anim anim_idle;
+   struct skeleton_anim anim_idle, anim_stand, anim_sit;
 
    enum npc_sub_state
    {
@@ -226,6 +234,8 @@ void _ent_npc_init(void)
       human->final_mtx = vg_linear_alloc( alloc, mtx_size );
    }
    player_get_anim( &_npc.anim_idle, "idle_lean+y" );
+   player_get_anim( &_npc.anim_stand, "idle_cycle+y" );
+   player_get_anim( &_npc.anim_sit, "sit" );
 }
 
 void _ent_npc_reset(void)
@@ -383,7 +393,14 @@ void _ent_npc_preupdate(void)
          pose->board.lean = 0.0f;
          v3_copy( human->co, pose->root_co );
          v4_copy( human->q, pose->root_q );
-         skeleton_sample_anim( sk, &_npc.anim_idle, vg.time*0.1f+0.4f, apose );
+
+         if( human->anim == k_npc_sit )
+            skeleton_sample_anim( sk, &_npc.anim_sit, 1.6f, apose );
+         else if( human->anim == k_npc_stand )
+            skeleton_sample_anim( sk, &_npc.anim_stand, vg.time*0.5f+0.4f, apose );
+         else
+            skeleton_sample_anim( sk, &_npc.anim_idle, vg.time*0.1f+0.4f, apose );
+
          skeleton_copy_pose( sk, apose, pose->keyframes );
          // no for JC.
          if( i != (k_npc_jc-1) )
@@ -539,6 +556,12 @@ entity_event_result ent_npc_event( ent_event *event )
       }
       else if( AF_STR_EQ( &world->meta.af, event->pstr_recieve_event, "proximity" ) )
       {
+         human->anim = 0;
+              if( AF_STR_EQ( &world->meta.af, npc->pstr_anim, "sit" ) )
+            human->anim = k_npc_sit;
+         else if( AF_STR_EQ( &world->meta.af, npc->pstr_anim, "stand" ) )
+            human->anim = k_npc_stand;
+
          if( human->alive == 0 )
          {
             const char *addons[] = 
index 04c1bb2a6d6c5318dbe07f58f9b53258ba8ae6fd..aa3b273cd0f3ae54b11674c1448bf41eedf63244 100644 (file)
@@ -65,7 +65,7 @@ entity_event_result ent_region_event( ent_event *event )
 /* 
  * reevaluate all achievements to calculate the compiled achievement
  */
-void ent_region_re_eval( world_instance *world )
+void ent_region_re_eval( world_instance *world, bool init )
 {
    u32 world_total = k_ent_route_flag_achieve_gold | k_ent_route_flag_achieve_silver;
 
@@ -105,13 +105,22 @@ void ent_region_re_eval( world_instance *world )
             }
          }
 
+         u32 original_flags = region->flags;
          region->flags = combined;
          world_total &= combined;
-
          if( region->flags & k_ent_route_flag_achieve_silver )
             _world_raise_event( mdl_entity_id( k_ent_region, j ), "silver" );
          if( region->flags & k_ent_route_flag_achieve_gold )
             _world_raise_event( mdl_entity_id( k_ent_region, j ), "gold" );
+
+         if( !init )
+         {
+            if( !(original_flags & (k_ent_route_flag_achieve_silver|k_ent_route_flag_achieve_gold)) &&
+                 region->flags & (k_ent_route_flag_achieve_silver|k_ent_route_flag_achieve_gold) )
+            {
+               gui_notify( "\xb3 Region completed!", 6.0f, k_ui_fg );
+            }
+         }
       }
    }
 
index c55edd2af9a5e75aaa14c5057009eb9e0b16d123..4565d6456a8d3852036db68b2fd6de904c85cf43 100644 (file)
@@ -16,5 +16,5 @@ struct ent_region_unlock_data
 };
 
 u32 region_spark_colour( u32 flags );
-void ent_region_re_eval( world_instance *world );
+void ent_region_re_eval( world_instance *world, bool init );
 entity_event_result ent_region_event( ent_event *event );
index c21f24bc38ba028d40c77c1ae3309fd95226cd06..228c3e63a6a68f068b3a35fc679e40ab0468b7db 100644 (file)
@@ -6,6 +6,7 @@ struct
 }
 _ent_script;
 
+#include "scripts/generic.c"
 #include "scripts/explode.c"
 #include "scripts/tutorial_island.c"
 #include "scripts/board_maker.c"
@@ -15,6 +16,7 @@ struct ent_script_table_entry _ent_script_table[] =
    { "explode", _skaterift_script_explode },
    { "volc_main", _skaterift_script_volc },
    { "board_maker", _skaterift_script_board_maker },
+   { "generic", _skaterift_script_generic },
    { NULL }
 };
 
index c1c7c3c2590f5fbf8161fc875ca68cd06d9ccdb7..bd627d015b6d14b79d9de9e8f111f17b1eef7aab 100644 (file)
@@ -772,7 +772,7 @@ struct ent_glider
 struct ent_npc 
 {
    mdl_transform transform;
-   u32 pstr_id, pstr_context_id;
+   u32 pstr_id, pstr_context_id, pstr_anim, none1;
 };
 
 typedef enum entity_event_result entity_event_result;
index ad50fb3528b5ba7ed0f34bdb337060068e9cad62..e36204d4052db15d1238c0fb02053942017b40c0 100644 (file)
--- a/src/gui.h
+++ b/src/gui.h
@@ -57,6 +57,14 @@ struct
    }
    helper_mode;
 
+   struct gui_notifier
+   {
+      const char *string;
+      f32 duration, time_left; /* seconds */
+      u32 colour;
+   }
+   notifiers[ 4 ];
+
    struct icon_call 
    {
       enum gui_icon icon;
@@ -85,6 +93,34 @@ struct
 }
 static gui = {.cur_icon_colour = {1.0f,1.0f,1.0f,1.0f},.colour_changed=1};
 
+void gui_notify( const char *string, f32 duration, u32 colour )
+{
+         // JINGLE SOME KEYS HERE
+         // JINGLE SOME KEYS HERE
+         // JINGLE SOME KEYS HERE
+         // JINGLE SOME KEYS HERE
+         // JINGLE SOME KEYS HERE
+   struct gui_notifier *notifier = NULL;
+   for( u32 i=0; i<VG_ARRAY_LEN(gui.notifiers); i ++ )
+   {
+      notifier = &gui.notifiers[i];
+      if( notifier->time_left > 0.0f )
+      {
+         notifier = NULL;
+         continue;
+      }
+      else break;
+   }
+
+   if( !notifier )
+      return;
+
+   notifier->string = string;
+   notifier->duration = duration;
+   notifier->time_left = duration;
+   notifier->colour = colour;
+}
+
 static void gui_helper_reset( enum gui_helper_mode mode )
 {
    gui.helper_count = 0;
@@ -161,10 +197,37 @@ static void gui_draw( ui_context *ctx )
    /* helpers 
     * -----------------------------------------------------------------  */
 
+   gui.factive = vg_lerpf( gui.factive, gui.helper_count?1.0f:0.0f, vg.time_frame_delta*2.0f );
+
+   {
+      ui_px y = 80;
+      ui_px w = 360, h = 60;
+      ctx->font = &vgf_default_large;
+      for( u32 i=0; i<VG_ARRAY_LEN(gui.notifiers); i ++ )
+      {
+         struct gui_notifier *notifier = &gui.notifiers[i];
+         notifier->time_left -= vg.time_frame_delta;
+         if( notifier->time_left > 0.0f )
+         {
+            const float k_trans = 0.2;
+            float t0 = notifier->time_left,
+                  t1 = notifier->duration - t0,
+                  t  = vg_smoothstepf( vg_minf( vg_minf( k_trans, t0 ), t1 ) / k_trans ),
+                  x  = (f32)(w+8) * t;
+            ui_rect box = { vg.window_x - (ui_px)x, y, w, h };
+            ui_fill( ctx, box, ui_opacity( GUI_COL_DARK, t*0.6f ) );
+            ui_outline( ctx, box, 1, ui_opacity( GUI_COL_NORM, t*0.6f ), 0 );
+            ui_text( ctx, box, notifier->string, 1, k_ui_align_middle_center, ui_colour( ctx, notifier->colour ) );
+         }
+         y += h + 8;
+      }
+   }
+
    if( _cutscene.state >= k_cutscene_state_ready )
+   {
+      ctx->font = &vgf_default_small;
       return;
-
-   gui.factive = vg_lerpf( gui.factive, gui.helper_count?1.0f:0.0f, vg.time_frame_delta*2.0f );
+   }
    
    ctx->font = &vgf_default_title;
    ui_px height = ctx->font->ch + 16;
index 991dfa9655cf10b796e54f9dfd0ea92b6939a226..8e8856eebb1f484cccdcd7b1f738fc6c943d12f9 100644 (file)
@@ -486,7 +486,6 @@ void cutscene_update( f32 delta )
       if( _cutscene.freeze_player )
          localplayer.immobile = 1;
 
-      _cutscene.state = k_cutscene_state_playing;
       vg_audio_lock();
       for( u32 j=0; j<af_arrcount( &_cutscene.meta.audios ); j++ )
       {
@@ -505,6 +504,8 @@ void cutscene_update( f32 delta )
          }
       }
       vg_audio_unlock();
+
+      _cutscene.state = k_cutscene_state_playing;
       _world_raise_event( _cutscene.raiser_entity, "start" );
    }
 
@@ -513,7 +514,7 @@ void cutscene_update( f32 delta )
 
    _cutscene.marker_this_frame = NULL;
    _cutscene.time += delta;
-   u32 frame = _cutscene.time * _cutscene.meta.info.framerate;
+   i32 frame = _cutscene.time * _cutscene.meta.info.framerate;
 
    /* clear out finished samplers */
    bool move = 0;
@@ -522,7 +523,7 @@ void cutscene_update( f32 delta )
    {
       struct cs_sampler *si = &_cutscene.samplers[i];
 
-      if( frame > (si->strip->offset + si->strip->strip.length) )
+      if( frame > (si->strip->offset + (i32)si->strip->strip.length) )
          move = 1;
       else
       {
@@ -547,7 +548,7 @@ void cutscene_update( f32 delta )
 
       if( strip->mode & k_ms_strip_mode_animation )
       {
-         if( frame > strip->offset + strip->strip.length )
+         if( frame > strip->offset + (i32)strip->strip.length )
          {
             vg_warn( "Skipping?\n" );
             _cutscene.strip ++;
@@ -886,6 +887,12 @@ static void cb_cutscene_view( ui_context *ctx, ui_rect rect, struct vg_magi_pane
       return;
    }
 
+   if( _cutscene.state == k_cutscene_state_unloading )
+   {
+      ui_text( ctx, rect, "Cutscene UN-loading..", 1, k_ui_align_middle_center, 0 );
+      return;
+   }
+
    ms_strip *usage[8];
    for( u32 i=0; i<VG_ARRAY_LEN(usage); i ++ ) usage[i] = NULL;
 
@@ -941,7 +948,7 @@ static void cb_cutscene_view( ui_context *ctx, ui_rect rect, struct vg_magi_pane
          for( u32 k=0; k<VG_ARRAY_LEN(usage); k ++ )
          {
             if( usage[k] )
-               if( usage[k]->offset + usage[k]->strip.length < strip->offset )
+               if( usage[k]->offset + (i32)usage[k]->strip.length < strip->offset )
                   usage[k] = NULL;
 
             if( !usage[k] )
@@ -952,7 +959,7 @@ static void cb_cutscene_view( ui_context *ctx, ui_rect rect, struct vg_magi_pane
             }
          }
 
-         ui_rect box = { strip->offset, layer*32, strip->strip.length, 30 };
+         ui_rect box = { strip->offset, layer*32, (i32)strip->strip.length, 30 };
          box[0] += root[0];
          box[1] += root[1];
 
@@ -972,6 +979,13 @@ static void cb_cutscene_view( ui_context *ctx, ui_rect rect, struct vg_magi_pane
    }
 }
 
+static int cmd_cutscene_play( int argc, const char *argv[] )
+{
+   if( argc == 1 )
+      _cutscene_load_and_play( argv[0], 0, 0 );
+   return 1;
+}
+
 static int cmd_cutscene_inspector( int argc, const char *argv[] )
 {
    ui_px w = 800, h = 400;
@@ -985,6 +999,6 @@ static int cmd_cutscene_inspector( int argc, const char *argv[] )
 
 void cutscene_init(void)
 {
-   //vg_console_reg_cmd( "cutscene", cmd_cutscene_load, NULL );
+   vg_console_reg_cmd( "cutscene_play", cmd_cutscene_play, NULL );
    vg_console_reg_cmd( "cutscene_inspector", cmd_cutscene_inspector, NULL );
 }
index fd2ef6d43587c3d30bb1861b11c81d079750b5a2..1f6a7971a367cb39e2f3b977844979760e725311 100644 (file)
@@ -67,7 +67,7 @@ enum ms_strip_mode
 struct ms_strip
 {
    u8  mode;
-   u32 offset;
+   i32 offset;
 
    union
    {
index 53e6cf8502bfb667140d85b021e94601b4bfb375..e4934c265952459a1afc6fcfe9bd945ef1a82787 100644 (file)
@@ -697,13 +697,14 @@ invalidated_grind:;
       joystick_state( k_srjoystick_steer, steer );
       v2_normalize_clamp( steer );
 
-      if( (fabsf(steer[1]) > 0.5f) && (state->land_dist >= 1.5f) ){
-         state->flip_rate = (1.0f/state->land_dist) * vg_signf(steer[1]) *
-                                 state->reverse ;
+      if( (fabsf(steer[1]) > 0.5f) && (state->land_dist >= 1.5f) )
+      {
+         state->flip_rate = (1.0f/state->land_dist) * vg_signf(steer[1]) * state->reverse;
          state->flip_time = 0.0f;
          v3_copy( localplayer.rb.to_world[0], state->flip_axis );
       }
-      else{
+      else
+      {
          state->flip_rate = 0.0f;
          v3_zero( state->flip_axis );
       }
@@ -721,9 +722,9 @@ invalidated_grind:;
 /*
  * Air control, no real physics
  */
-static void skate_apply_air_model(void){
+static void skate_apply_air_model(void)
+{
    struct player_skate_state *state = &player_skate.state;
-
    if( state->activity_prev > k_skate_activity_air_to_grind )
       player__approximate_best_trajectory();
 
@@ -3129,8 +3130,8 @@ void player__skate_animate(void){
       
 
    /* flip angle */
-   if( (state->activity <= k_skate_activity_air_to_grind) &&
-       (fabsf(state->flip_rate) > 0.01f) ){
+   if( (state->activity <= k_skate_activity_air_to_grind) && (fabsf(state->flip_rate) > 0.01f) )
+   {
       float substep = vg.time_fixed_extrapolate;
       float t  = state->flip_time+state->flip_rate*substep*vg.time_fixed_delta;
             sign  = vg_signf( t );
index db0e0c57eed2c97cdd092675b5242d79574a5a0d..2480cf979acee3676c9f5ab91bb30317ddbf3d05 100644 (file)
@@ -1,68 +1,21 @@
-
-struct board_maker_unlock_waiter
+static bool _skaterift_script_generic( ent_script_event *event )
 {
-   bool changed;
-   bool unlocked;
-};
-
-static bool _skaterift_script_board_maker_unlock( ent_script_event *event )
-{
-#if 0
-   if( event->type == k_escript_event_allocate )
-   {
-      struct script_event_allocate *event_info = event->info;
-      struct board_maker_unlock_waiter *waiter = vg_linear_alloc( event_info->heap, sizeof(struct board_maker_unlock_waiter) );
-      waiter->changed = 0;
-      waiter->unlocked = 0;
-      event_info->userdata = waiter;
-   }
-
-   u64 status;
-   if( on_atom_changed( event, "board_maker_unlock", &status ) )
+   if( event->type == k_escript_event_world_event )
    {
-      struct board_maker_unlock_waiter *waiter = event->userdata;
-      waiter->changed = 1;
-      waiter->unlocked = status;
-   }
-
-   if( event->type == k_escript_event_update || event->type == k_escript_event_world_start )
-   {
-      if( _cutscene.state == k_cutscene_state_none )
+      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, "unlock_mtzero" ) ) 
       {
-         struct board_maker_unlock_waiter *waiter = event->userdata;
-         if( waiter->changed )
-         {
-            _ent_list_set_visible( event->entity_list, waiter->unlocked );
-            waiter->changed = 0;
-         }
+         gui_notify( "\xb8 Mt.Zero Unlocked!", 8.0f, k_ui_green );
       }
-   }
-#endif
-   return 1;
-}
-
-#if 0
-static bool _skaterift_script_board_maker( ent_script_event *event )
-{
-   if( on_function_trigger( event, 0 ) )
-   {
-      if( world_set_event( k_world_event_board_maker ) )
+      if( AF_STR_EQ( &world->meta.af, inf->event->pstr_recieve_event, "unlock_city" ) ) 
+      {
+         gui_notify( "\xb8 Downtown Unlocked!", 8.0f, k_ui_green );
+      }
+      if( AF_STR_EQ( &world->meta.af, inf->event->pstr_recieve_event, "unlock_valley" ) ) 
       {
-         struct ent_list_iter iter;
-         _ent_list_iter_start( &iter, event->entity_list, k_ent_marker );
-         while( _ent_list_iter( &iter ) )
-         {
-            ent_marker *marker = af_arritm( &event->world->ent_marker, iter.index );
-            const char *alias = af_str( &event->world->meta.af, marker->pstr_alias );
-
-            if( !strcmp( alias, "$board_position" ) )
-               v3_copy( marker->transform.co, _board_maker.origin );
-            else if( !strcmp( alias, "$camera_position" ) )
-               v3_copy( marker->transform.co, _board_maker.camera_pos );
-         }
-         _board_maker_open();
+         gui_notify( "\xb8 Valley Unlocked!", 8.0f, k_ui_green );
       }
    }
    return 1;
 }
-#endif
index ae485aa1ba45c401ea9695494fcf6d1caabe16a3..1b34a81eebe48661e2d506ed7712cbbb5f06a576 100644 (file)
@@ -663,6 +663,8 @@ void world_entity_start( world_instance *world, vg_msg *sav )
       }
    }
 
+   _atom_list_clear( k_atom_list_world );
+
    vg_msg_cursor orig = sav->cur;
    if( vg_msg_seekframe( sav, "atoms" ) )
    {
@@ -676,7 +678,7 @@ void world_entity_start( world_instance *world, vg_msg *sav )
       }
    }
 
-   ent_region_re_eval( world );
+   ent_region_re_eval( world, 1 );
 
    /* true/false initializers 
     * ----------------------------------------------------------------------------------- */
index a8aa6e172cd6903c92bdcc68afe43809b0c20a23..4ff46c80db7a8e4b8e0377e687da37fcd8bbd638 100644 (file)
@@ -439,7 +439,6 @@ void world_switcher_update(void)
       vg_str folder_str;
       vg_strnull( &folder_str, info->path, sizeof(info->path) );
       info->OK = addon_get_content_folder( _world.load_addon, &folder_str );
-      _atom_list_clear( k_atom_list_world );
       vg_async_task_dispatch( task, skaterift_world_load_t1 );
    }
 
index cc784f2315fc2ee51e6eb4a61da22bca2f6641eb..d7b9f5206d1e2667d8120b8d517c5f771128c023 100644 (file)
@@ -118,9 +118,20 @@ static void world_routes_time_lap( u32 route_index )
       if( (route->best_laptime == 0.0) || (lap_time < route->best_laptime) )
          route->best_laptime = lap_time;
 
+      u32 original_flags = route->flags;
+
       route->flags |= k_ent_route_flag_achieve_silver;
       if( clean ) route->flags |= k_ent_route_flag_achieve_gold;
-      ent_region_re_eval( world );
+      ent_region_re_eval( world, 0 );
+
+      if( (route->flags & k_ent_route_flag_achieve_gold) && !(original_flags & k_ent_route_flag_achieve_gold) )
+      {
+         gui_notify( "\xb3 Route completed in gold!", 5.0f, k_ui_yellow );
+      }
+      else if( (route->flags & k_ent_route_flag_achieve_silver) && !(original_flags & k_ent_route_flag_achieve_silver) )
+      {
+         gui_notify( "\xb3 Route completed in silver!", 5.0f, k_ui_fg );
+      }
 
       struct ent_script_event event;
       struct script_event_completion_changed inf = {