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: Is it possible?  (Read 5498 times)

0 Members and 1 Guest are viewing this topic.

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 34
    • View Profile
Is it possible?
« on: September 24, 2015, 09:35:46 AM »

Hello,

I am trying to generate some enitises around actor, but I need somehow to calculate that entities outside region "floor" is not visible, can it be achieved?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Is it possible?
« Reply #1 on: September 24, 2015, 09:34:45 PM »

I'm not sure I understand, can you tell us what the entities are supposed to represent?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Is it possible?
« Reply #2 on: September 29, 2015, 09:23:31 AM »

Hello,

Already worked this this out.

I have other question.

How to dynamically add regions not entity regions to main layer.
I made turn based mode in game, that generates some move tiles, based on floor layer, but now I need to add dynamically some other layers so these move layers don't show in these positions.

I tried such script, but it didn't work, cant query points:

Code: WME Script
  1. function SetBadGuyColision (BadGuy){
  2.  
  3. var MainLayer = Scene.GetLayer("main");
  4. var ColisionRegion = MainLayer.InsertRegion(20,"BadguyColision");
  5.  
  6. ColisionRegion.AddPoint(BadGuy.X, BadGuy.Y);
  7. ColisionRegion.AddPoint(BadGuy.X+130, BadGuy.Y);
  8. ColisionRegion.AddPoint(BadGuy.X+130, BadGuy.Y+130);
  9. ColisionRegion.AddPoint(BadGuy.X, BadGuy.Y+130);
  10.  
  11. DevMsg("Point1", ColisionRegion.GetPoint(1));
  12. DevMsg("Point2", ColisionRegion.GetPoint(2));
  13. DevMsg("Point3", ColisionRegion.GetPoint(3));
  14. DevMsg("Point4", ColisionRegion.GetPoint(4));
  15.  
  16. }
« Last Edit: September 29, 2015, 09:26:51 AM by Dendrobats »
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: Is it possible?
« Reply #3 on: October 01, 2015, 10:57:32 AM »

I have not done a any work dynamically creating regions, but as a first diagnostic I would try to create a variable to hold each point something like

var point1 = CollisionRegion.GetPoint(1);

if (point1 == null)
{
blah, blah}

then you can be really sure if your regions points are being stored.

Again this may be my ignorance, but I have often got confused between the different functionality in an entity region and a region/region
Logged

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Is it possible?
« Reply #4 on: October 08, 2015, 08:41:36 AM »

Another question:

If I add layer:

var BlockRegion = MainLayer.InsertRegion(100,"BadguyBlock");

How to set it as Blocked region?

Thease one dont work:
BlockRegion.Type = "Blocked";
BlockRegion.Blocked;
Logged

Dendrobats

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Is it possible?
« Reply #5 on: October 08, 2015, 08:56:35 AM »

Ok I found out that I just needed to write it like this to work:

BlockRegion.Blocked = true;
Logged
 

Page created in 0.03 seconds with 25 queries.