Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Script initiates extending the floor after an event  (Read 5150 times)

0 Members and 1 Guest are viewing this topic.

jimm84

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • View Profile
    • JD Portfolio
Script initiates extending the floor after an event
« 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, :)
Logged
Hello! :-) Illustration & Animation Portfolio http://jdillustration.jimmsdesign.co.uk/

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Script initiates extending the floor after an event
« Reply #1 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
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Script initiates extending the floor after an event
« Reply #2 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 ;)
Logged

jimm84

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • View Profile
    • JD Portfolio
Re: Script initiates extending the floor after an event
« Reply #3 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...
Logged
Hello! :-) Illustration & Animation Portfolio http://jdillustration.jimmsdesign.co.uk/

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Script initiates extending the floor after an event
« Reply #4 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:)
« Last Edit: May 02, 2013, 11:01:14 AM by keybone »
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

jimm84

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • View Profile
    • JD Portfolio
Re: Script initiates extending the floor after an event
« Reply #5 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,
Logged
Hello! :-) Illustration & Animation Portfolio http://jdillustration.jimmsdesign.co.uk/
 

Page created in 0.022 seconds with 25 queries.