Hey guys, I hope you can help me out with this one.
I just opted into the beta and tried the editor, have read a bit of the documentation and basically found what I was looking for already:
http://www.grimrock.net/modding/how-to- ... ve-puzzle/
However, I am not quite satisfied with just putting an item on top of my altar to open a gate. I want a little additional condition.
Instead, I'd like to have the player pick up a Skull and a Dagger onto the altar. The twist? The player must have drawn blood with the Dagger at least once.
Ideally, I'd want to require the player to pick a party member who 'uses' the Dagger to sacrifice a few HP, without needing an enemy to get involved.
I hope I didn't overlook anything too obvious.
Any hint on how to get this to work?
Help will be much appreciated!
Item-on-Altar with additional condition
- DarkChaplain
- Posts: 2
- Joined: Sat Sep 22, 2012 1:44 am
- Contact:
Re: Item-on-Altar with additional condition
I'm not the greatest coder, but I believe you could actually manage this by using a wand and just loading the dagger graphic onto it.The altar could then check the number of charges on the dagger to ensure it's been used.
Re: Item-on-Altar with additional condition
Actually, I missed the obvious here - use the venom dagger as your base item, and just tie in a script to check the charge value remaining and return false if it's still maxed.
- DarkChaplain
- Posts: 2
- Joined: Sat Sep 22, 2012 1:44 am
- Contact:
Re: Item-on-Altar with additional condition
Hah! I found a way!
First I introduced two new items:
There's the Sacrificial Dagger, which is placed into an alcove in the altar room.
It is consumable, which clears it from the game after usage.
Upon using it, the champion loses 15 health (I tried the "damage(type, amount)" function first, but it would crash the game, so I took a look at the way potions work and inverted the healing). Fittingly, the game plays a champion-based damage sound.
Since the SD isn't what we want, the consumption spawns the second item, the Bloodied Dagger, at the party's current position. It will lie at their feet, which isn't too bad, as I imagine the character might simply drop his dagger, which I thought I'd accentuate with the "impact_blade" sound effect.
Now that the BD is in play, all that's left is placing it onto the altar to open the door, as explained in the Item on an Alcove Puzzle page. I combined it with another item, a skull, and the door opens nicely with both those items placed on the altar.
If you want to take a look at the whole thing in motion, go ahead =)
http://www.mediafire.com/download.php?w07c8f5r7wllu06
First I introduced two new items:
Code: Select all
cloneObject{
name = "sacrificial_dagger",
baseObject = "dagger",
uiName = "Sacrificial Dagger",
attackPower = 12,
damageType = "physical",
description = "This dagger has not tasted blood in a long time...",
consumable = True,
emptyItem = "bloodied_dagger",
onUseItem = function(item, champion)
hudPrint("Ouch!")
champion:playDamageSound()
champion:modifyStat("health", -15)
playSound("impact_blade", 1, party.x, party.y)
spawn("bloodied_dagger", 1, party.x, party.y, party.facing)
return true
end,
}
cloneObject{
name = "bloodied_dagger",
baseObject = "dagger",
uiName = "Bloodied Dagger",
attackPower = 12,
damageType = "physical",
description = "A dagger coated in fresh blood.",
}
It is consumable, which clears it from the game after usage.
Upon using it, the champion loses 15 health (I tried the "damage(type, amount)" function first, but it would crash the game, so I took a look at the way potions work and inverted the healing). Fittingly, the game plays a champion-based damage sound.
Since the SD isn't what we want, the consumption spawns the second item, the Bloodied Dagger, at the party's current position. It will lie at their feet, which isn't too bad, as I imagine the character might simply drop his dagger, which I thought I'd accentuate with the "impact_blade" sound effect.
Now that the BD is in play, all that's left is placing it onto the altar to open the door, as explained in the Item on an Alcove Puzzle page. I combined it with another item, a skull, and the door opens nicely with both those items placed on the altar.
If you want to take a look at the whole thing in motion, go ahead =)
http://www.mediafire.com/download.php?w07c8f5r7wllu06
Re: Item-on-Altar with additional condition
that's a very cool setup you've put together, nice!
Finished Dungeons - complete mods to play