new stairs system automatically go up and down

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

new stairs system automatically go up and down

Post by jonnydeep »

Hi. Use the stairs scripts in eob1 for automatically up and down.
Next time post image and file with tutorial for using.
Bye.
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

ok start.
First in dir your project/mod_assets/scripts add new object.lua and mod init.lua
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

-- This file has been generated by Dungeon Editor 1.3.1
-- TODO: place your custom dungeon object definitions here
--- Jonny Deep---

defineObject{
name = "HIDDEN_PLATE_DOWN",
class = "PressurePlate",
model = "assets/models/env/dungeon_pressure_plate.fbx",
activateAnim = "assets/animations/env/dungeon_pressure_plate_down.fbx",
deactivateAnim = "assets/animations/env/dungeon_pressure_plate_up.fbx",
hidden = true,
silent = true,
placement = "floor",
editorIcon = 48,
}

defineObject{
name = "HIDDEN_PLATE_UP",
class = "PressurePlate",
model = "assets/models/env/dungeon_pressure_plate.fbx",
activateAnim = "assets/animations/env/dungeon_pressure_plate_down.fbx",
deactivateAnim = "assets/animations/env/dungeon_pressure_plate_up.fbx",
hidden = true,
silent = true,
placement = "floor",
editorIcon = 44,
}
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

This scripts in "init.lua" (standar def. + my function)
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

-- This file has been generated by Dungeon Editor 1.3.1

-- import standard assets
import "assets/scripts/standard_assets.lua"

-- import custom assets
import "mod_assets/scripts/items.lua"
import "mod_assets/scripts/monsters.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/scripts/wall_sets.lua"
import "mod_assets/scripts/recipes.lua"
import "mod_assets/scripts/spells.lua"
import "mod_assets/scripts/materials.lua"
import "mod_assets/scripts/sounds.lua"

cloneObject {
name = "party",
baseObject = "party",

onMove = function(self, dir)

px = party.x
py = party.y
pl = party.level

if dir == 0 then
py = py-1
elseif dir == 2 then
py = py+1
elseif dir == 1 then
px = px+1
elseif dir == 3 then
px = px-1
end

local i = 1
while findEntity("HIDDEN_PLATE_DOWN_"..i) and
findEntity("HIDDEN_PLATE_UP_"..i) do
sl = findEntity("HIDDEN_PLATE_DOWN_"..i).level
sx = findEntity("HIDDEN_PLATE_DOWN_"..i).x
sy = findEntity("HIDDEN_PLATE_DOWN_"..i).y

if sl == pl then
if sx == px then
if sy == py then

if tele then
tele:destroy()
clock:destroy()
end

x1 = findEntity("HIDDEN_PLATE_DOWN_"..i).x
y1 = findEntity("HIDDEN_PLATE_DOWN_"..i).y
f1 = findEntity("HIDDEN_PLATE_DOWN_"..i).facing
l1 = findEntity("HIDDEN_PLATE_DOWN_"..i).level

x2 = findEntity("HIDDEN_PLATE_UP_"..i).x
y2 = findEntity("HIDDEN_PLATE_UP_"..i).y
f2 = findEntity("HIDDEN_PLATE_UP_"..i).facing
l2 = findEntity("HIDDEN_PLATE_UP_"..i).level

if f2 == 0 then
y2 = y2-1
elseif f2 == 2 then
y2 = y2+1
elseif f2 == 1 then
x2 = x2+1
elseif f2 == 3 then
x2 = x2-1
end

spawn("teleporter",l1+1,x1,y1,f2, "tele")
:setTriggeredByParty(true)
:setTriggeredByMonster(false)
:setTriggeredByItem(false)
:setTeleportTarget(x2,y2,f2,l2)
:setInvisible(true)
:setSilent(true)
:setHideLight(true)
:setScreenFlash(false)
:deactivate()
spawn("timer",l1+1,x1,y1,f2, "clock")
:setTimerInterval(1)
:addConnector("activate", "tele", "deactivate")

if findEntity("HIDDEN_PLATE_DOWN_"..i) then
tele:activate()
clock:activate()
else
tele:deactivate()
end


end
end
end

sl = findEntity("HIDDEN_PLATE_UP_"..i).level
sx = findEntity("HIDDEN_PLATE_UP_"..i).x
sy = findEntity("HIDDEN_PLATE_UP_"..i).y

if sl == pl then
if sx == px then
if sy == py then

if tele then
tele:destroy()
clock:destroy()
end

x1 = findEntity("HIDDEN_PLATE_UP_"..i).x
y1 = findEntity("HIDDEN_PLATE_UP_"..i).y
f1 = findEntity("HIDDEN_PLATE_UP_"..i).facing
l1 = findEntity("HIDDEN_PLATE_UP_"..i).level

x2 = findEntity("HIDDEN_PLATE_DOWN_"..i).x
y2 = findEntity("HIDDEN_PLATE_DOWN_"..i).y
f2 = findEntity("HIDDEN_PLATE_DOWN_"..i).facing
l2 = findEntity("HIDDEN_PLATE_DOWN_"..i).level

if f2 == 0 then
y2 = y2-1
elseif f2 == 2 then
y2 = y2+1
elseif f2 == 1 then
x2 = x2+1
elseif f2 == 3 then
x2 = x2-1
end

spawn("teleporter",l1-1,x1,y1,f2, "tele")
:setTriggeredByParty(true)
:setTriggeredByMonster(false)
:setTriggeredByItem(false)
:setTeleportTarget(x2,y2,f2,l2)
:setInvisible(true)
:setSilent(true)
:setHideLight(true)
:setScreenFlash(false)
:deactivate()
spawn("timer",l1-1,x1,y1,f2, "clock")
:setTimerInterval(1)
:addConnector("activate", "tele", "deactivate")

if findEntity("HIDDEN_PLATE_UP_"..i) then
tele:activate()
clock:activate()
else
tele:deactivate()
end


end
end
end
i = i + 1
end

end,
}
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

Adding 2 object name "HIDDEN_PLATE_DOWN" and "HIDDEN_PLATE_UP (use base "hidden_plesure_plate").
This object have icone same at STAIR_DOWN and STAIR_UP.

Place HIDDEN_PLATE_DOWN in screen and place same block normal STAIR_DOWN.
Very important the direction, HIDDEN_PLATE_DOWN opposite at normal STAIR_DOWN (my script use direction for exit stair transition face opposite at STAIR)
Another important editor generete automatic number after name objcet (ex. HIDDEN_PLATE_UP_1 , HIDDEN_PLATE_UP_2 , etc.)
My script use number for collegate HIDDEN_PLATE_DOWN ad HIDDEN_PLATE_UP.
Last requisite have project in LEVEL 1 only down using stair and dont forget add new LEVEL
at drawing in corrent LEVEL.
(ex. LEVEL 1 (using for introduction at game)
(LEVEL 2 drawing your dungeon)
(LEVEL 3 make before drawing LEVEL 2 by error and close editor)

Next time post the turorial and picture.

For any questions reply here.
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: new stairs system automatically go up and down

Post by HaunterV »

1. Someone come in and put this into something cut n paste-able form.

2. Johnny you need to dl Notepad ++ or something so you can edit it natively in notepad.

3. I don't understand what he means by eob style stairs... someone enlighten me? does that mean we have ladder style descent options ?

On an almost unrelated note, can someone make a spiral staircase...
like this:
Image the ones on the left of the pick going up.

I think they'd be a touch more useful than the 2x1 stairs we currently have.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

Code: Select all

--  This file has been generated by Dungeon Editor 1.3.1
--  TODO: place your custom dungeon object definitions here 
--- Jonny Deep---

defineObject{
	name = "HIDDEN_PLATE_DOWN",
	class = "PressurePlate",
	model = "assets/models/env/dungeon_pressure_plate.fbx",
	activateAnim = "assets/animations/env/dungeon_pressure_plate_down.fbx",
	deactivateAnim = "assets/animations/env/dungeon_pressure_plate_up.fbx",
	hidden = true,
	silent = true,
	placement = "floor",
	editorIcon = 48,
}

defineObject{
	name = "HIDDEN_PLATE_UP",
	class = "PressurePlate",
	model = "assets/models/env/dungeon_pressure_plate.fbx",
	activateAnim = "assets/animations/env/dungeon_pressure_plate_down.fbx",
	deactivateAnim = "assets/animations/env/dungeon_pressure_plate_up.fbx",
	hidden = true,
	silent = true,
	placement = "floor",
	editorIcon = 44,
}
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.1

-- import standard assets
import "assets/scripts/standard_assets.lua"

-- import custom assets
import "mod_assets/scripts/items.lua"
import "mod_assets/scripts/monsters.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/scripts/wall_sets.lua"
import "mod_assets/scripts/recipes.lua"
import "mod_assets/scripts/spells.lua"
import "mod_assets/scripts/materials.lua"
import "mod_assets/scripts/sounds.lua"

-- cloneobject Party for function "hidden.down" and "hidden.up"

cloneObject {
	name = "party",
	baseObject = "party",
	
	onMove = function(self, dir)
		px = party.x
		py = party.y
		pl = party.level
		if dir == 0 then 
			py = py-1
		elseif dir == 2 then
			py = py+1
		elseif dir == 1 then
			px = px+1
		elseif dir == 3 then
			px = px-1
		end
	local i = 1
	while findEntity("HIDDEN_PLATE_DOWN_"..i)  and
	      findEntity("HIDDEN_PLATE_UP_"..i) do
		sl = findEntity("HIDDEN_PLATE_DOWN_"..i).level
		sx = findEntity("HIDDEN_PLATE_DOWN_"..i).x
		sy = findEntity("HIDDEN_PLATE_DOWN_"..i).y
	if sl == pl then
		if sx == px then
			if sy == py then
if tele then
	tele:destroy()
	clock:destroy()
end
	x1 = findEntity("HIDDEN_PLATE_DOWN_"..i).x
	y1 = findEntity("HIDDEN_PLATE_DOWN_"..i).y
	f1 = findEntity("HIDDEN_PLATE_DOWN_"..i).facing
	l1 = findEntity("HIDDEN_PLATE_DOWN_"..i).level
	x2 = findEntity("HIDDEN_PLATE_UP_"..i).x
	y2 = findEntity("HIDDEN_PLATE_UP_"..i).y
	f2 = findEntity("HIDDEN_PLATE_UP_"..i).facing
	l2 = findEntity("HIDDEN_PLATE_UP_"..i).level
if f2 == 0 then 
		y2 = y2-1
	elseif f2 == 2 then
		y2 = y2+1
	elseif f2 == 1 then
		x2 = x2+1
	elseif f2 == 3 then
		x2 = x2-1
end
	spawn("teleporter",l1+1,x1,y1,f2, "tele")
		:setTriggeredByParty(true)
		:setTriggeredByMonster(false)
		:setTriggeredByItem(false)
		:setTeleportTarget(x2,y2,f2,l2)
		:setInvisible(true)
		:setSilent(true)
		:setHideLight(true)
		:setScreenFlash(false)
		:deactivate()
	spawn("timer",l1+1,x1,y1,f2, "clock")
		:setTimerInterval(1)
		:addConnector("activate", "tele", "deactivate")
if findEntity("HIDDEN_PLATE_DOWN_"..i) then
	tele:activate()
	clock:activate()
else
	tele:deactivate()
end
			end
		end
	end
		sl = findEntity("HIDDEN_PLATE_UP_"..i).level
		sx = findEntity("HIDDEN_PLATE_UP_"..i).x
		sy = findEntity("HIDDEN_PLATE_UP_"..i).y
	if sl == pl then
		if sx == px then
			if sy == py then
if tele then
	tele:destroy()
	clock:destroy()
end
	x1 = findEntity("HIDDEN_PLATE_UP_"..i).x
	y1 = findEntity("HIDDEN_PLATE_UP_"..i).y
	f1 = findEntity("HIDDEN_PLATE_UP_"..i).facing
	l1 = findEntity("HIDDEN_PLATE_UP_"..i).level
	x2 = findEntity("HIDDEN_PLATE_DOWN_"..i).x
	y2 = findEntity("HIDDEN_PLATE_DOWN_"..i).y
	f2 = findEntity("HIDDEN_PLATE_DOWN_"..i).facing
	l2 = findEntity("HIDDEN_PLATE_DOWN_"..i).level
if f2 == 0 then 
		y2 = y2-1
	elseif f2 == 2 then
		y2 = y2+1
	elseif f2 == 1 then
		x2 = x2+1
	elseif f2 == 3 then
		x2 = x2-1
end
	spawn("teleporter",l1-1,x1,y1,f2, "tele")
		:setTriggeredByParty(true)
		:setTriggeredByMonster(false)
		:setTriggeredByItem(false)
		:setTeleportTarget(x2,y2,f2,l2)
		:setInvisible(true)
		:setSilent(true)
		:setHideLight(true)
		:setScreenFlash(false)
		:deactivate()
	spawn("timer",l1-1,x1,y1,f2, "clock")
		:setTimerInterval(1)
		:addConnector("activate", "tele", "deactivate")
if findEntity("HIDDEN_PLATE_UP_"..i) then
	tele:activate()
	clock:activate()
else
	tele:deactivate()
end
			end
		end
	end
	i = i + 1
	end
	
	end,
}
jonnydeep
Posts: 18
Joined: Tue Oct 23, 2012 6:23 pm

Re: new stairs system automatically go up and down

Post by jonnydeep »

Sorry my mistake non eob1 but anoter discussion not remember where,
use script and teleport and timer for up and down in different location
and in many level (ex. level2 up to down level2 same level different location
or down level2 to up level5).

LEVEL 2
Make my object "HIDDEN_STAIR_DOWN_1" in map (ex. pos x10 y10 dir west(3))
and make defaul DUNGEON_STAIR_DOWN_1 in same position ( x10 y 10 dir est(1))

LEVEL 2
Make my object "HIDDEN_STAIR_UP_1" in map (ex. pos x20 y20 dir north(0))
and make defaul DUNGEON_STAIR_UP_1 in same position ( x20 y 20 dir sud(2))

Important the "_1" number editor adding automatic, this number collegate
for go a stairs up or down automatic.
The number adding at DUNGEON_STAIR_UP or _DOWN not important,
use this assets for transition go down and up fader effect.

I thing next time post the exemple a dungeon.
Bye.
Post Reply