scripting elevations?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

scripting elevations?

Post by THOM »

Is it possible to set a specific floortile from elevation 0 to -1 by scripting?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: scripting elevations?

Post by Batty »

You can use GameObject:setPosition(x, y, facing, elevation, level) like this:

Code: Select all

floortile_1:setPosition(floortile_1.x, floortile_1.y, floortile_1.facing, -1, floortile_1.level)
or you can use this script to move an object down 1 square:

Code: Select all

local coord = floortile_1:getWorldPosition()
coord[2] = coord[2] - 3
floortile_1:setWorldPosition(coord)
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: scripting elevations?

Post by THOM »

Well - I don't mean an object - I am talking about an landcape tile. Lets say a forest_ground tile.

Is there a possibility?

In case, that you also were talking about that - how is the name of a forest-/beach-/dungeon-/watever-groundtil?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: scripting elevations?

Post by Isaac »

Tile elevations are definitely loaded before the level starts; they are written on the base map, and I suspect, impossible to move. What you could do is move a bridge asset up or down. This could of course mean an entire floor of custom floor-tile [placeables].
Post Reply