Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: jimm84 on April 07, 2013, 09:08:01 PM

Title: Script initiates extending the floor after an event
Post by: jimm84 on April 07, 2013, 09:08:01 PM
Figured I should start a new thread. I'm playing with script becoming more familiar with WME work area...

Now for the thing I would not have a clue how to do. Imagine a pit and you can only stand on one side. You trigger an event and the bridge comes down and then I want the character to be able to step across bridge and exit the room.

So... can't step across the room. interact, cause bridge to come down and then you can step across.

Would a solution be to stop the character from moving in the init script or something similar (the floor is present the whole time) and once the event of the bridge has happened the character can move?

Thanks, :)
Title: Re: Script initiates extending the floor after an event
Post by: keybone on April 08, 2013, 11:28:04 AM
hi,
y can try to create "add Region" and use:
 
Code: WME Script
  1. var vRegion=Scene.GetNode("RegionName");
  2. global VariableBridge;
  3. if (VariableBridge != true ) //bridge Up
  4.         {
  5.   vRegion.Active=false ;
  6.     }
  7.  
  8. if (VariableBridge == true) //bridge down
  9.         {
  10.   vRegion.Active=true ; //
  11.     }

is only a idea :) ::wave
Title: Re: Script initiates extending the floor after an event
Post by: Azrael on April 08, 2013, 04:34:18 PM
Or you can use a blocked region that disappear once the bridge is "available" quite in the same way as keybone wrote ;)
Title: Re: Script initiates extending the floor after an event
Post by: jimm84 on April 09, 2013, 10:49:12 PM
Thank you both! I will have a tinker, I was wandering is there a place in this forum that has more tuts of commonly used snippets of code? I have found a handful in the resource but it ends there really...
Title: Re: Script initiates extending the floor after an event
Post by: keybone on May 02, 2013, 08:56:31 AM
Thank you both! I will have a tinker, I was wandering is there a place in this forum that has more tuts of commonly used snippets of code? I have found a handful in the resource but it ends there really...

try in section script, tool http://forum.dead-code.org/index.php?board=12.0... there are scripts and tools.

by:)
Title: Re: Script initiates extending the floor after an event
Post by: jimm84 on May 12, 2013, 09:44:36 AM
Hello keybone, no matter how many ways I tried to cut i can't get this script to work (thanks anyway), I have tried to place it in scene_init and on the objectsprite script itself (boulder).
If you could get shed some light, that would be great. Current the script I have placed is on the object itself.

#include "scripts\base.inc"

var stoneonfloor = Scene.GetNode("stone");
var boulder = this.GetSpriteObject();


on "FirstFrame"
{
 boulder.Pause();

}

on "LastFrame"
{
 boulder.Pause();
 var boulderstay = true; 
 var vRegion=Scene.GetNode("crashregion");
    global VariableBridge;
    if (VariableBridge != true ) //bridge Up
            {
      vRegion.Active=false ;
        }
     
    if (VariableBridge == true) //bridge down
            {
      vRegion.Active=true ; //
        }
      //global VariableBridge == true;
}
//----------------------
So basically when the animation plays and hits (lastframe) the script to make make the ground passable is initiated. If you could help that would be great.

Thanks,