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?
Custom Condition: Undead
Re: Custom Condition: Undead
Undead state should make undead not want to attack you.
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
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
- Shloogorgh
- Posts: 45
- Joined: Sat Sep 22, 2012 12:24 am
Re: Custom Condition: Undead
great idea, now we just need an AI state "passive"HaunterV wrote:Undead state should make undead not want to attack you.
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,
}- Shloogorgh
- Posts: 45
- Joined: Sat Sep 22, 2012 12:24 am
Re: Custom Condition: Undead
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?
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
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!
Steven Seagal of gaming industry
Re: Custom Condition: Undead
Workaround for this would be to clone some udead monsters putting either:Shloogorgh wrote:great idea, now we just need an AI state "passive"HaunterV wrote:Undead state should make undead not want to attack you.
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....
Last edited by Blichew on Fri Sep 28, 2012 12:04 pm, edited 2 times in total.
Re: Custom Condition: Undead
What's to stop your undead companion from taking a bite out of you?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!