Re: Ask a simple question, get a simple answer
Posted: Tue Dec 09, 2014 3:30 am
paste the script you used to spawn them to make things easy
Official Legend of Grimrock Forums
http://grimrock.net/forum/
do something like this:TheLastOrder wrote:Watching this tutorial:
https://www.youtube.com/watch?v=-YlAZwq ... Nc&index=7
It comes to my mind that somehow you need to stop the script once it has finished. Otherwise, the game crashes if you put BANE back into the altar and you pick it again, as long as the monster doesn't exist anymore...
Do I need a Boolean or something to stop that?
I tried this
dungeon_alcove_magma:destroy()
but the game crashes.
So the simple question is:
How to stop calls into scripts for BOSSFIGHTS that can't be triggered again?
Code: Select all
onlyOnce = false
function trap()
if onlyOnce == false then
onlyOnce = true
--do stuff
end
end
Code: Select all
function firstButton()
dd_1.door:open()
spawn("wall_button", 8, 11, 11, 2, 0, "button_1").clickable:addConnector("onClick", "script_entity_25", "secondButton")
wall_button_7.clickable:disable()
end
function secondButton()
dd_2.door:open()
spawn("wall_button", 8, 5, 17, 3, 0, "button_2").clickable:addConnector("onClick", "script_entity_25", "thirdButton")
button_1.clickable:disable()
end
function thirdButton()
dd_3.door:open()
spawn("wall_button", 8, 22, 3, 3, 0, "button_3").clickable:addConnector("onClick", "script_entity_25", "fourthButton")
button_2.clickable:disable()
end
function fourthButton()
dd_4.door:open()
spawn("wall_button", 8, 7, 5, 2, -1, "button_4").clickable:addConnector("onClick", "script_entity_25", "fifthButton")
button_3.clickable:disable()
end
function fifthButton()
dd_5.door:open()
spawn("wall_button", 8, 1, 17, 1, 0, "button_5").clickable:addConnector("onClick", "script_entity_25", "sixthButton")
button_4.clickable:disable()
end
function sixthButton()
dd_6.door:open()
button_5.clickable:disable()
end
Code: Select all
button_1:destroy()
Awesome, it works but I still have a problem: the countdown resets (the monster recovers all its health) if I place back an item and remove it while the countdown is in progress!GoldenShadowGS wrote:do something like this:TheLastOrder wrote:Watching this tutorial:
https://www.youtube.com/watch?v=-YlAZwq ... Nc&index=7
It comes to my mind that somehow you need to stop the script once it has finished. Otherwise, the game crashes if you put BANE back into the altar and you pick it again, as long as the monster doesn't exist anymore...
Do I need a Boolean or something to stop that?
I tried this
dungeon_alcove_magma:destroy()
but the game crashes.
So the simple question is:
How to stop calls into scripts for BOSSFIGHTS that can't be triggered again?Code: Select all
onlyOnce = false function trap() if onlyOnce == false then onlyOnce = true --do stuff end end
Code: Select all
onlyOnce = false
function startmagmacountdown()
if onlyOnce == false then
onlyOnce = true
magma_countdown.bossfight:addMonster(magma_countdown_turtle.monster)
magma_countdown.bossfight:activate()
timer_magma.timer:start()
dungeon_door_portcullis_9.door:close()
party.party:shakeCamera(0.04,15)
dungeon_fire_pit_1.particle:enable()
dungeon_fire_pit_2.particle:enable()
dungeon_fire_pit_3.particle:enable()
dungeon_fire_pit_4.particle:enable()
dungeon_fire_pit_5.particle:enable()
dungeon_fire_pit_6.particle:enable()
dungeon_fire_pit_7.particle:enable()
end
timecount = 1
function hurtturtle()
if timecount == 1 then
elseif timecount == 2 then
elseif timecount == 3 then
magma_countdown_turtle.monster:setHealth(95)
elseif timecount == 4 then
magma_countdown_turtle.monster:setHealth(90)
elseif timecount == 5 then
magma_countdown_turtle.monster:setHealth(85)
elseif timecount == 6 then
magma_countdown_turtle.monster:setHealth(80)
elseif timecount == 7 then
magma_countdown_turtle.monster:setHealth(75)
elseif timecount == 8 then
magma_countdown_turtle.monster:setHealth(70)
elseif timecount == 9 then
magma_countdown_turtle.monster:setHealth(65)
elseif timecount == 10 then
magma_countdown_turtle.monster:setHealth(60)
elseif timecount == 11 then
magma_countdown_turtle.monster:setHealth(55)
elseif timecount == 12 then
magma_countdown_turtle.monster:setHealth(50)
elseif timecount == 13 then
magma_countdown_turtle.monster:setHealth(45)
elseif timecount == 14 then
magma_countdown_turtle.monster:setHealth(40)
elseif timecount == 15 then
magma_countdown_turtle.monster:setHealth(35)
elseif timecount == 16 then
magma_countdown_turtle.monster:setHealth(30)
elseif timecount == 17 then
magma_countdown_turtle.monster:setHealth(25)
elseif timecount == 18 then
magma_countdown_turtle.monster:setHealth(20)
elseif timecount == 19 then
magma_countdown_turtle.monster:setHealth(15)
elseif timecount == 20 then
magma_countdown_turtle.monster:setHealth(10)
elseif timecount == 21 then
magma_countdown_turtle.monster:setHealth(5)
elseif timecount == 22 then
magma_countdown_turtle.monster:setHealth(0)
elseif timecount == 23 then
magma_countdown.bossfight:deactivate()
magma_countdown_turtle.monster:die();
die = true;
timer_magma.timer:stop()
spawn("flame_wave", 7, 27, 9, 1, 0)
spawn("flame_wave", 7, 29, 9, 1, 0)
spawn("flame_wave", 7, 27, 11, 1, 0)
spawn("flame_wave", 7, 29, 11, 1, 0)
spawn("flame_wave", 7, 27, 13, 1, 0)
spawn("flame_wave", 7, 29, 13, 1, 0)
spawn("flame_wave", 7, 28, 15, 1, 0)
timecount = 1
return
end
timecount = timecount + 1
end
function dontshakeitbaby()
dungeon_fire_pit_1.particle:disable()
dungeon_fire_pit_2.particle:disable()
dungeon_fire_pit_3.particle:disable()
dungeon_fire_pit_4.particle:disable()
dungeon_fire_pit_5.particle:disable()
dungeon_fire_pit_6.particle:disable()
dungeon_fire_pit_7.particle:disable()
end
end
Code: Select all
alcove_1.surface:removeConnector("onRemoveItem", "Script_entity_1", "function")
So, what you want is a button that spawns another button. When the next button is pressed, it destroys the previous button, right?Grimfan wrote:It is a little more complicated however in the fact that each created button is on a central timer that resets every time a button is clicked. If the button isn't reached in time however that button (and any previous buttons) are destroyed.