Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Sun Sep 30, 2012 3:41 pm
Hi all.
This script returns the direct number of squares between obj1 and obj2.
Code: Select all
function getDistance(obj1,obj2)
local distance = 0
local XNumber = math.max(obj1.x,obj2.x) - math.min(obj1.x,obj2.x)
local YNumber = math.max(obj1.y,obj2.y) - math.min(obj1.y,obj2.y)
distance = XNumber + YNumber
return distance
end
enjoy
Last edited by
cromcrom on Mon Oct 01, 2012 10:15 am, edited 1 time in total.
A trip of a thousand leagues starts with a step.
Komag
Posts: 3659 Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA
Post
by Komag » Mon Oct 01, 2012 2:17 am
that's a nice one, I like it! the closest thing to this in the original game was the dragon statues lining up thing, and I loved that one too. You could give clues to the player, compass headings, relative distance, etc
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Mon Oct 01, 2012 8:51 am
Should it go to the useful scripts then ?
A trip of a thousand leagues starts with a step.
petri
Posts: 1917 Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland
Post
by petri » Mon Oct 01, 2012 9:48 am
XNumber and YNumber should be local, otherwise they will be unnecessarily saved with save games.
cromcrom
Posts: 549 Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Post
by cromcrom » Mon Oct 01, 2012 10:15 am
Fixed, thanks
A trip of a thousand leagues starts with a step.
Komag
Posts: 3659 Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA
Post
by Komag » Mon Oct 01, 2012 12:09 pm
yes, repository worthy!