[SOLVED] How to update Regions without collisions?

xRANDBOx

  • *
  • Posts: 41
i have the scene set where the Player starts inside of "Region 0".  I am aware that the region block detects entry and exit, there is also a if actor is inside region. the issue i am having is, when the actor/player enters/starts in the region, events do not occur until player has a collision. such as colliding with a wall or object. exiting region seems to be working but that is a result of collision getting things started in the region. is there a way to make the actor/player force update what region it is in? thanks.

« Last Edit: April 13, 2018, 03:26:35 pm by xRANDBOx »

colburt187

  • *
  • Posts: 2201
You could use the 'Actor is inside region' block in an updating event.

when updating
 if player is inside region 0
do thing.

Vaibhav Sangwan

  • Posts: 154
create the region outside of the screen and then in when created event of the scene, move it to the desired place. That should work I think.

xRANDBOx

  • *
  • Posts: 41
You could use the 'Actor is inside region' block in an updating event.

when updating
 if player is inside region 0
do thing.

i have used the 'Actor is inside region' block with the same result as creating the region event on the left list.As i mentioned in the post. Both have required that a collision take place with the player before events start. As of now i have and am working with a NULL object to constantly bump into player so that the regions will update like they should. Though it is a pain having to find a solution to make regions refresh and work as intended.

JeffreyDriver

  • Posts: 1597
How many regions are you dealing with? You could just check the position of the player. E.g if x-centre of player is > VALUE and x-centre of player is < VALUE etc.

In an updating event, that would always be running.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

xRANDBOx

  • *
  • Posts: 41
currently dealing with 5 regions for the first level. Checking player position to mark event as true sounds very interesting. i will check this out.  This may have solved my issue, instead of using regions ill use check position. Thank you for the idea!

xRANDBOx

  • *
  • Posts: 41
YES! This solved the issue! Thanks JeffreyDriver!

 
How many regions are you dealing with? You could just check the position of the player. E.g if x-centre of player is > VALUE and x-centre of player is < VALUE etc.

In an updating event, that would always be running.

Sample Code attached.

JeffreyDriver

  • Posts: 1597
I'm glad it worked. I tried using regions a long time ago, but it really dragged down performance. Using maths was much less intensive on the engine.

It's a bit more effort on your part to set the x y min max values, but in terms of performance, it's good.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk