Page 113 of 396
Re: Ask a simple question, get a simple answer
Posted: Mon Feb 15, 2016 11:05 pm
by akroma222
Hey folks,
Just a quick question - has anyone attempted to make a Cloud object/spell - that causes the Sleep condition??
As in a cloud / damageTile that Sleeps monsters whenever it deals damage (yes I realise damage wakes up monsters)
Just wondering if anyone has a work around for this?
Ive tried the basics like this:
Code: Select all
{
class = "TileDamager",
attackPower = 1,
repeatCount = 5,
repeatDelay = 1,
onHitMonster = function(self, monster)
monster:setCondition("sleep", 10)
if monster:hasCondition("sleep") then
monster:setConditionValue("sleep", 10)
end
end,
},
and also tried delayed calling other functions to Sleep the monster
Code: Select all
{
class = "TileDamager",
attackPower = 1,
--sound = "dark_bolt_hit",
--screenEffect = "dark_bolt_screen",
repeatCount = 5,
repeatDelay = 1,
onHitMonster = function(self, monster)
delayedCall("trapSpellScripts", 0.2, "setSleepingMonster", monster.go.name)
end,
},
function setSleepingMonster(mon)
local m = findEntity(mon)
if m and m.monster then
print("monster")
m.monster:setCondition("sleep", 10)
if m.sleeping then
print("sleeping monster")
end
end
end
No joy... any hints or tips!?
Akroma
Re: Ask a simple question, get a simple answer
Posted: Mon Feb 15, 2016 11:27 pm
by minmay
onHitMonster executes before damage is dealt, not after. So if you don't return false (which cancels the damage), the monster is going to wake up immediately.
I do not have the time to test it right now but I'm pretty sure it would be easiest to just not do any damage with the TileDamager:
Code: Select all
{
class = "TileDamager",
attackPower = 1,
repeatCount = 5,
repeatDelay = 1,
onHitMonster = function(self, monster)
if monster:isAlive() then
monster:setCondition("sleep", 10)
end
return false
end,
onHitObstacle = function() return false end,
onHitChampion = function() return false end,
},
If you want to do damage as well, just use two TileDamagers:
Code: Select all
{
class = "TileDamager",
attackPower = 1,
repeatCount = 5,
repeatDelay = 1,
},
{
class = "TileDamager",
name = "sleeper",
attackPower = 1,
repeatCount = 5,
repeatDelay = 1,
onHitMonster = function(self, monster)
if monster:isAlive() then
monster:setCondition("sleep", 10)
end
return false
end,
onHitObstacle = function() return false end,
onHitChampion = function() return false end,
},
Just make sure the TileDamager that inflicts sleep is after the TileDamager that does damage in the object definition. (Components generally initialize in the same order they are in the component table, and TileDamagers deal damage in the same order they are in the component table.)
Using delayedCalls for something like this is a bad idea imo,
especially using delayedCalls with delays greater than 0. You want the sleep to happen as soon as possible after the damage; if you wait a frame (or, god forbid, multiple frames like you were doing...) you risk the monster moving, being dead, etc.
Re: Ask a simple question, get a simple answer
Posted: Tue Feb 16, 2016 7:44 am
by akroma222
Ahh such a silly error on my part, I knew I was messing up the timing somehow!!
Thanks heaps minmay
Re: Ask a simple question, get a simple answer
Posted: Tue Feb 16, 2016 10:44 am
by Modraneth
someone know about a dungeon floor filled with water and some cave with lava?
i want to place this on my mod, if possible and if already exist can u show me the link?
Re: Ask a simple question, get a simple answer
Posted: Tue Feb 16, 2016 11:27 am
by THOM
Dungeon with water is included in the main-game.
And Lava can be found by the search-function:
viewtopic.php?f=22&t=9141&hilit=lava
Re: Ask a simple question, get a simple answer
Posted: Tue Feb 16, 2016 2:33 pm
by Modraneth
i want a dungeon floor with water on the floor, not the main game floor
its like just water on the floor with a "spash" sound when u move over it
EDIT: and thanks for the link to lava
Re: Ask a simple question, get a simple answer
Posted: Wed Feb 17, 2016 4:53 am
by 2Four
Is there simple way to re-create the wooden/plank bridges in the sewers of LOG2 in the editor?
I've searched the item list for items such as 'wooden', 'bridge', 'plank' and 'platform'.
I just can't seem to find it! is there a way to lay those plank bridges down on a map?
TIA!
Re: Ask a simple question, get a simple answer
Posted: Wed Feb 17, 2016 5:40 am
by minmay
2Four wrote:Is there simple way to re-create the wooden/plank bridges in the sewers of LOG2 in the editor?
I've searched the item list for items such as 'wooden', 'bridge', 'plank' and 'platform'.
I just can't seem to find it! is there a way to lay those plank bridges down on a map?
TIA!
Here is a dungeon editor file that will load Isle of Nex. You can then look at how all the levels in the game were made and find the name of any object you want.
The bridges in question are 'forest_bridge'.
Re: Ask a simple question, get a simple answer
Posted: Wed Feb 17, 2016 5:13 pm
by 2Four
Holy cow!
That's neat, thanks a bunch minmay!!
Re: Ask a simple question, get a simple answer
Posted: Mon Feb 22, 2016 2:43 am
by THOM
I need a socket to hold it's item forever. The player should insert a specific item which shoudn't be able to be picked up again.
But whatever I try, I can't get it to work. The item stays pickable. Anyone an idea?
What I tried:
- add in the object-definition a function which sets onRemoveItem to false after something is inserted
- disable the socket.component after something is inserted
- destroying the item in the mouse and recreate it in the socket
In my particular case the socket can be reached from behind and it seems, that it doesn't act like a socket anymore from this direction. Maybe items are always grapable from behind?