Page 1 of 1
Custom Condition: Undead
Posted: Thu Sep 27, 2012 2:15 am
by Shloogorgh
I had an idea but am unsure how to implement it. I wanted characters to be afflicted with an undead curse. Unless I can think of something better, I'll just have it be a cosmetic change that turns their portrait into the skull.
Does anyone know if there is a way to prevent characters from being able to use consumable items? Or a way to stop their hunger process altogether? (that might be doable actually, with a script that checks if the player is undead and constantly modifies their food stat with the champion:modifyFood(#) script)
Hmm... actually, if I modified certain consumable items, I think I could make it so that health potions damage undead characters...
The real question then would be if I can make it so food items don't register as consumable to undead characters...
Also, is it possible to make characters immune to poison or disease?
Re: Custom Condition: Undead
Posted: Thu Sep 27, 2012 3:12 am
by HaunterV
Undead state should make undead not want to attack you.
Re: Custom Condition: Undead
Posted: Thu Sep 27, 2012 5:23 am
by Shloogorgh
HaunterV wrote:Undead state should make undead not want to attack you.
great idea, now we just need an AI state "passive"
Okay, so I was changing the script for food so that the undead could not eat it. But I ran into a problem. Since you can't define a custom condition, I was planning on using the portrait to determine if you were undead or not (all undead would have the skull portrait) so I made this script:
Code: Select all
defineObject{
name = "pitroot_bread",
class = "Item",
uiName = "Pitroot Bread",
model = "assets/models/items/pitroot_bread.fbx",
gfxIndex = 58,
consumable = true,
onUseItem = function(self, champion)
if champion:getPortrait() == "assets/textures/portraits/dead.tga" then
return false
else
playSound("consume_food")
champion:modifyFood(450)
return true
end
end,
weight = 1.0,
}
Turns out the function getPortrait doesn't exist, so I can't use that. What could I use as a value that indicates the champion is undead? How do I script this?
Re: Custom Condition: Undead
Posted: Thu Sep 27, 2012 8:21 pm
by Shloogorgh
Okay, so if when the "condition" is inflicted, and I use the code
print(champion:getName().." has been turned undead")
how do I make use of this later, like in the code for my pitroot bread above?
Re: Custom Condition: Undead
Posted: Fri Sep 28, 2012 9:55 am
by antti
You could store the information about who is undead in variables (or better yet, a table containing variables for all the characters like this for instance: undeadChampions = { false, false, false, false } ) and then check the value of the variable when consuming the bread. It can be a little complicated but I hope this points you in the right direction!
Re: Custom Condition: Undead
Posted: Fri Sep 28, 2012 11:27 am
by Blichew
Shloogorgh wrote:HaunterV wrote:Undead state should make undead not want to attack you.
great idea, now we just need an AI state "passive"
Workaround for this would be to clone some udead monsters putting either:
1. override
monster.sight = 0 (
will it even work ? I mean is range 0 equivalent of monster's spot so technically you'd have to be on monster tile to be seen)
2. override
monster:onAttack() function with return false - this way monster wouldn't attack like, ever, right ?
next step would be despawn all normal undead monsters and spawn those with new brainless/blind type on the same spot.
This might work and tbh you, Sir, just gave me a very neat idea for the next puzzle:
1. there's this room with let's say 5 overpowered (oneshoting the party) snails
2. puts an item (snail part) into alcove, screen flashes, shakes, etc. and snails are replaced with brainless ones (also party movement sound changes to slime's - that's the hilarious part imo) - timer starts.
3. party can now move through the room freely, but there's this timer. If party is distracted by something (alcove, text, etc) and don't make it to the end "transformation" effect ends and overpowered snails are back, sound is changed back, and party is dead
damn, now I can't wait till I get home to implement this....

Re: Custom Condition: Undead
Posted: Fri Sep 28, 2012 12:00 pm
by Neikun
What's to stop your undead companion from taking a bite out of you?