Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

MapPosition (Lib to check for walls, bushes, regions)[v205@03.12.16]]


  • Please log in to reply
1 reply to this topic

#1
Maxxxel

Maxxxel

    The One

  • Scripts Developer
  • 1,196 posts
  • LocationGuess the right City to win 10$

With MapPosition you can easily check a given position if its in a wall, a bush or in a speific region.

(Note: on very first start of a map or after an update, the script will generate 2 files per map: _bushes & _walls, this process can take up to 15 seconds. In this time no scripts are working. Please reload the script on finish by pressing 2xF6)
 
 
API

--This will make the script use the lib, place it on top of the script
require 'MapPositionGOS'

--Functions--
MapPosition:inWall(position) 
->returns true if a given position is in a wall
->position can be Vector2, Vector3, Object, Table

MapPosition:inBush(position) 
->returns true if a given position is in a bush
->position can be Vector2, Vector3, Object, Table


(for regions look in the spoiler down here)

Spoiler

 

Examples

Spoiler

 

 

(This lib is automatically downloaded but if you want to see the source)
Soucre (raw)


  • 7

#2
gamsteron

gamsteron

    Advanced Member

  • Scripts Developer
  • 931 posts

nice job

 

i have little problem with: MapPosition:intersectsWall(pointOrLinesegment)

first case return false  :(

Q4DNirn.png

 

 

no problem -> just need check:

if (InWall(point1) and InWall(point2)) or intersectsWall(LineSegment(point1, point2)) then

...

end


  • 0




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users