Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: What is a way to make an object out of reach.  (Read 2803 times)

0 Members and 1 Guest are viewing this topic.

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 352
    • View Profile
    • Jyujinkai's WME Development Blog
What is a way to make an object out of reach.
« on: September 27, 2007, 02:09:41 AM »

Ok still super new to all this....

I can click an object and walk to it and activate the script attached to it.
I can walk though a region and activate the script attached to it.

My question is can I set up a mouse click and if it is out of reach get an "I can reach it" thing. (I know you can but how)

I am assuming it would use if statements.

The way i am doing it at the moment is to have a region to note the "in reach" area and have a if thing on the script for the entity that checks to see if the actor is in the region.... This dose seam to work but it also seam to be pretty weird as i have like a bazzilion regions all over my scene...

Is ther a better way to do this?
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: What is a way to make an object out of reach.
« Reply #1 on: September 27, 2007, 09:08:41 AM »

how about testing actor.X and actor.Y to Entity.X and Entity.Y? This way you can set up what is the "reasonable" proximity + you can sort of automate the process?
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile
Re: What is a way to make an object out of reach.
« Reply #2 on: September 27, 2007, 02:39:33 PM »

What exactly are you trying to do?

If you want the player to move close to an object before using it, just use the region script triggers to set a boolean when entering, and the surrounding regions when leaving.

But I doubt that you want to disable the "automatic walkto", so I guess you want to use this for an object, which can be seen by the player, but not yet reached, for there is something to be done before (open the cage, lower the bridge or something similar).
In this case, you can use booleans to reflect the states, and if the player clicks on something behind our imaginary bridge, the script will check wether "BridgeLowered" is true, and if it is not, it can output "I cannot reach this from here".

The same works for objects on "the other side of the gap", if the right part of the scene is reached from other screens, not from this one. In this case, the simplest way would be to set up two matching scenes, one for the right part and one for the left, for example, and hardcode the "cannot reach that from here"-outputs on the opposing side.
« Last Edit: September 27, 2007, 02:41:27 PM by sychron »
Logged
... delete the inner sleep ...
 

Page created in 0.043 seconds with 23 queries.