Custom Condition: Undead

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Custom Condition: Undead

Post 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?
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Custom Condition: Undead

Post by HaunterV »

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
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Re: Custom Condition: Undead

Post 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?
User avatar
Shloogorgh
Posts: 45
Joined: Sat Sep 22, 2012 12:24 am

Re: Custom Condition: Undead

Post 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?
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Custom Condition: Undead

Post 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!
Steven Seagal of gaming industry
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Custom Condition: Undead

Post 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.... :D
Last edited by Blichew on Fri Sep 28, 2012 12:04 pm, edited 2 times in total.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Custom Condition: Undead

Post by Neikun »

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
  • Message me to join in!
Post Reply