Page 223 of 396
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 14, 2018 3:43 pm
by bongobeat
minmay wrote:bongobeat wrote:This works, except you cannot throw an item on the mouse pointer when you are one square back, in front of the wall. But a throwing weapon can be thrown when placed on the hands. But this doesnt bother.
This happens because it's marked as a secret door. If you remove secretDoor = true from the definition, you'll be able to throw items through it using the mouse.
(The only other effect of secretDoor is that it changes how the door is displayed on the automap.)
but there is not the secreDoor = true in the definition
I don't understand, sorry.
Anyway I don't use this much longer.
I use a secret door, opened and closing fastly instead of something that act like a forcefield.
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 14, 2018 3:51 pm
by akroma222
bongobeat wrote:but there is not the secreDoor = true in the definition
I don't understand, sorry.
Try adding:
to the definition, see if that helps at all....
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 14, 2018 3:57 pm
by bongobeat
here I am with another silly issue
please take a look at these 2 screenshots:
the first you see reflection in the ocean
the second, I walk on the ocean tile, and the reflection .... disappears
I know hot this happen.
On the same map I use 3 beach_ocean (in the west, north and east)
and one water_surface in the south, followed by another beach_ocean in the very south. (this beach_ocean is to see ocean at large, when you are not underwater, because there is some bridges where you can walk on, etc... anyway we don't care about this 4th beach_ocean, because we can't walk in it.
The problem comes from the water_surface: before I placed it, the reflection on other beach_oceans was working good. It seems that the water surface interferes with the reflection of all beach_ocean.
By the way, reflection in the water_surface is working good to.
So, how can I have reflection on all beach_ocean, with keeping the water_surface?
For now I've tried to put the water_surface on the map first, then all oceans. The reflection works everywhere, but when you enter the water_surface, underwater I mean, there is no fog anymore. So this is not a good solution.
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 14, 2018 6:56 pm
by minmay
You should never have multiple WaterSurfaceComponents on the same level. Remove all the WaterSurfaceComponents except one. You can still use multiple models for the ocean, but there should only be one WaterSurfaceComponent on the level.
Re: Ask a simple question, get a simple answer
Posted: Thu Mar 15, 2018 3:47 am
by Mysterious
Hi all.
I am trying to make a Potion that kills whoever drinks it eg:
Code: Select all
{
class = "UsableItem",
sound = "consume_potion",
onUseItem = function(self, champion)
champion:setMaxHealth("-1")
hudPrint(champion:getName() .. " Drinks the potion and is doomed.")
return true
end,
},
},
}
Why is the command: champion:setMaxHealth("-1") not working? In the references you can set health stat of any champ. Or how do I kill the Champ with what command?
Thxs in advance
Re: Ask a simple question, get a simple answer
Posted: Thu Mar 15, 2018 4:01 am
by Isaac
champion:damage(1000, "pure")
Re: Ask a simple question, get a simple answer
Posted: Thu Mar 15, 2018 4:02 am
by akroma222
Mysterious wrote:Why is the command: champion:setMaxHealth("-1") not working? In the references you can set health stat of any champ. Or how do I kill the Champ with what command?
Hey Mysterious,
try changing this line:
to this:
*You were setting the champs Max Health instead of the their actual current Health - no need to set Max Health lower to kill a champ
*Numbers do not need " " (only strings do)
Hope this helps!
EDIT: Isaac's solution^^ will also get the job done
Re: Ask a simple question, get a simple answer
Posted: Thu Mar 15, 2018 4:06 am
by Isaac
It just depends if they should scream and show damage, or not.
**Also, for a more tailored damage amount...
Code: Select all
champion:damage(champion:getHealth(), "pure")
Re: Ask a simple question, get a simple answer
Posted: Thu Mar 15, 2018 4:54 am
by akroma222
Isaac wrote:It just depends if they should scream and show damage, or not.
They should definitely scream
I would also humbly suggest a short delay between drinking the potion and the champ dying and screaming...
Code: Select all
{
class = "UsableItem",
sound = "consume_potion",
onUseItem = function(self, champion)
local ord = champion:getOrdinal()
delayedCall("potion_script", 4.0, "doomPotionEffects", ord)
hudPrint(champion:getName() .. " drinks the Potion ...")
return true
end,
},
--- paste the following function into a script entity named "potion_script"
Code: Select all
function doomPotionEffects(ordinal)
local champion = party.party:getChampionByOrdinal(ordinal)
if champion:isAlive()
and champion:getEnabled()
and not champion:hasCondition("petrified") then
local h = champion:getHealth()
champion:damage(h, "pure")
--champion:playDamageSound()
playSound("champion_die")
party.party:playScreenEffect("damage_screen")
hudPrint("... and suffers a horrid demise!")
end
end
EDIT - updated & corrected (again
) - Ta minmay
Re: Ask a simple question, get a simple answer
Posted: Thu Mar 15, 2018 4:59 am
by minmay
That code won't work properly because it tries to pass a Champion through delayedCall. You can only pass numbers, booleans, and strings through delayedCall. Pass the champion's ordinal instead and retrieve the champion with PartyComponent:getChampionByOrdinal().