Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Pages: [1] 2  All

Author Topic: Blocking regions and releasing them back to use...how to do?  (Read 8541 times)

0 Members and 1 Guest are viewing this topic.

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Blocking regions and releasing them back to use...how to do?
« on: October 28, 2008, 06:52:41 PM »

Hi, I tried to block one region (make it blocked from sceneedit) and then make a if statement that should release it if item is given to one guy. I tried this:

if (!TeleportOpen) Region.Blocked = true;
else Region.Blocked = false;

but as usually it didn't work...it was only blocked for eternity :) hehe, I know this might be very basic to you guys, but I can't figure it out. The TeleportOpen is set to true if item is given to one npc entity. plz help :P

Thanks already!

- Kypho the Beginner
Logged

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Blocking regions and releasing them back to use...how to do?
« Reply #1 on: October 28, 2008, 07:01:20 PM »

It may be something more, but I would put some brackets in that script to begin with:

if (!TeleportOpen)
{Region.Blocked = true;
}
else
{Region.Blocked = false;
}

Although I don't think the last bracket set is absolutely necessary. If this doesn't help, it's something deeper.



« Last Edit: October 28, 2008, 07:05:18 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Blocking regions and releasing them back to use...how to do?
« Reply #2 on: October 28, 2008, 07:22:10 PM »

unfortunately it was something deeper, still wondering how deep :P ???
Logged

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Blocking regions and releasing them back to use...how to do?
« Reply #3 on: October 28, 2008, 07:32:26 PM »

Someone will help you, I'm sure.  Meanwhile, I did a search and found this:

var blockedDeskRegion = Scene.GetNode("block_desk");
  blockedDeskRegion.Blocked = false;

You could try fitting that code into your conditional code somehow if--what you wanted to happen as a condition happens but you have to use your own variable and region name. 

I'd like to know what works too.  This seems like something I'd be using quite a bit.  : )  This does sound like something basic but I can't find any documentation on it.
« Last Edit: October 28, 2008, 07:44:58 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Blocking regions and releasing them back to use...how to do?
« Reply #4 on: October 28, 2008, 09:09:25 PM »

you get it all wrong. Blocked region is a node in the scene.

Code: WME Script
  1. var e = Scene.GetNode("YourRegion");
  2. e.Active = true;
  3.  
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Blocking regions and releasing them back to use...how to do?
« Reply #5 on: October 28, 2008, 09:14:37 PM »

Thank you.  :  )
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Blocking regions and releasing them back to use...how to do?
« Reply #6 on: October 29, 2008, 04:13:20 AM »

Kypho, are you OK now?
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Blocking regions and releasing them back to use...how to do?
« Reply #7 on: October 29, 2008, 09:05:29 AM »

we scared him away. :)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Blocking regions and releasing them back to use...how to do?
« Reply #8 on: October 29, 2008, 02:45:15 PM »

Hi Meta and Catacomber :) Yes I am here and not scared, brave as a sir Lancelot :D...Thanks for your help, I'll try meta's code later today...see if I can get it work ;)

- Kypho the beginner
Logged

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Blocking regions and releasing them back to use...how to do?
« Reply #9 on: October 29, 2008, 03:39:26 PM »

Huh and Hi again :/ I can't get it working still...
Here is what I got...
Code: [Select]
#include "scripts\base.inc"

global TeleportOpen;

var e = Scene.GetNode("guarded");

on "LeftClick"
{
if (!TeleportOpen)
 {
 e.Active = false;
 actor.Talk("I am too scared of the space monster!");
 actor.Talk("I can't go there");
 }
 else
 {
 e.Active = true;
 actor.Talk("I think I can go there now safely");
 }
}

"guarded" is the name of my region and TeleportOpen is a global variable storing boolean false/true value.
The LeftClick didn't do anything if take the leftclick code away, it says I am too scared of the space monster! in the start of scene (as it should), but later I can't get the else branch working at all...


ALSO I tried following:

Code: [Select]
#include "scripts\base.inc"

global TeleportOpen;

var e = Scene.GetNode("guarded");

if (!TeleportOpen)
 {
 e.Active = true;
 e.Blocked = true;
 }
 else
 {
 e.Active = true;
 e.Blocked = false;
 }

but neither any of this code works :P

- Kypho the beginner
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Blocking regions and releasing them back to use...how to do?
« Reply #10 on: October 29, 2008, 03:54:09 PM »

The script looks correct to me. Where exactly is the script loacted (i.e. what is it attached to?)?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Blocking regions and releasing them back to use...how to do?
« Reply #11 on: October 29, 2008, 03:57:04 PM »

Hi :)

This script is tried to attach to "guarded" region as a guarded.script...I saw that you can put scripts to region, so I put and you can neither get to there from scenes folder or from sceneEdit.

- Kypho the beginner
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Blocking regions and releasing them back to use...how to do?
« Reply #12 on: October 29, 2008, 04:00:16 PM »

Well, scene regions aren't "clickable", i.e. their scripts can never receive the LeftClick events. If you need a clickable region, you'll have to place some interactive object over it. Region *entity* might me a good candidate.

Scene regions are used to build scene layout. They are not interactive.
Region entities are invisible interactive spots within the scene.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Blocking regions and releasing them back to use...how to do?
« Reply #13 on: October 29, 2008, 04:04:37 PM »

AHhH, I see...thanks for your support again  O0

- Kypho
Logged

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Blocking regions and releasing them back to use...how to do?
« Reply #14 on: October 29, 2008, 04:18:54 PM »

Hmm, now when I changed it to region entity it says the first texts when clicking on the region, but later when it should let the region be active when TeleportOpen == true then it doens't say anything or let the character walk on the area. I have the first codes now, which I put here after your glues...
Logged
Pages: [1] 2  All
 

Page created in 0.208 seconds with 24 queries.