Requesting some specific helpful tips

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

alois wrote:
Aleitheo wrote:Everything up until the part where the death of the skeleton patrol is supposed to open both the gate and the hidden door does not work. This I do not understand.
If you want, you may change the onDie routine for the skeleton to

Code: Select all

cloneObject{
   name = "LvlOneCellSkeletonPatrol",
   baseObject = "skeleton_patrol",
   onDie = function(self)
      LvlOneCellPort:open()
      LvlOneCellSecret:open()
      end,
}
Here I'm assuming that "LvlOneCellPort" and "LvlOneCellSecret" are the ids of the two doors you want to open.

alois :)
Port is the porticulis gate for the cell you first enter into and Secret is the hidden door inside the room with the enemy.

I copied your script in place of the original, saved, loaded up the editor and tried it out several times but no success. I deleted the instance of the enemy I had placed in the editor and replaced it, I deleted the counter and I reloaded a few times inbetween, no luck.

Right now, if anyone has a dungeon of theirs with more than one "on die" monsters in it, would they mind posting the monsters.lua for me to see?
Ryeath_Greystalk
Posts: 366
Joined: Tue Jan 15, 2013 3:26 am
Location: Oregon

Re: Requesting some specific helpful tips

Post by Ryeath_Greystalk »

Here is mine. It has a few onDie() monsters

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.6

-- TODO: place your custom monster definitions here

cloneObject{
	name = "weakspider",
	baseObject = "spider",
	health = 50,
	attackPower = 12,
	accuracy = 3,
	exp = 25,
}

cloneObject{
	name = "bossherder",
	baseObject = "herder",
	health = 600,
	sight = 4,
	attackPower = 20,
	evasion = 0,
	exp = 400,
	onDie = function(self)
		temple_door_ornament_9:open()
		sinfulthoughtsdoor:open()
		end,
}

cloneObject{
	name = "officesnail",
	baseObject = "snail",
	onDie = function(self)
		OfficeCounter:decrement()
		end,
}

cloneObject{
	name = "officeherder",
	baseObject = "herder",
	health = 250,
	onDie = function(self)
		OfficeDoor1:open()
		end,
}

cloneObject{
	name = "headguard",
	baseObject = "skeleton_warrior",
	health = 250,
	attackPower = 11,
	movementCoolDown = 1.5,
	exp = 150,
	onDie = function(self)
		dungeon_secret_door_4:open()
		whomastertimer:activate()
		end,
}

cloneObject{
	name = "testsnail",
	baseObject = "snail",
	health = 800,
}

cloneObject{
	name = "twoexitguard",
	baseObject = "skeleton_warrior",
	health = 500,
	attackPower = 14,
	movementCoolDown = 1.2,
	exp = 400,
	onDie = function(self)
		leveltwoexitdooriron:open()
		leveltwobosstimer:activate()
		end,
}
If you keep having issues with you can send me a copy of your dungeon files and I could try to figure it out. No guarantees but I could try.
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

My monsters.lua

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.7

-- TODO: place your custom monster definitions here
cloneObject{
   name = "LvlOneCellSkeletonPatrol",
   baseObject = "skeleton_patrol",
   onDie = function(self)
      LvlOneCellPort:open()
      LvlOneCellSecret:open()
      end,
}

cloneObject{
   name = "LvlOneTriangleSnail",
   baseObject = "snail",
   onDie = function(self)
      LvlOneTriangleCounter:decrement()
      end,
}
My init.lua

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.7

-- import standard assets
import "assets/scripts/standard_assets.lua"

-- import custom assets
import "mod_assets/scripts/items.lua"
import "mod_assets/scripts/monsters.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/scripts/wall_sets.lua"
import "mod_assets/scripts/recipes.lua"
import "mod_assets/scripts/spells.lua"
import "mod_assets/scripts/materials.lua"
import "mod_assets/scripts/sounds.lua"
import "mod_assets/scripts/mine/mine_objects.lua"
import "mod_assets/scripts/mine/mine_wall_sets.lua"
import "mod_assets/scripts/mine/mine_materials.lua"
import "mod_assets/scripts/mine/mine_sounds.lua"
import "mod_assets/scripts/secret_doors_extras.lua"
import "mod_assets/log_desk/log_desk.lua"
import "mod_assets/log_carpets/log_carpets.lua"
import "mod_assets/grim_sqtable/grim_sqtable.lua"
import "mod_assets/grim_bed/grim_bed.lua"
import "mod_assets/grim_rtable/grim_rtable.lua"
import "mod_assets/scripts/sx_extra_lanterns.lua"
import "mod_assets/scripts/northern_dungeon_wall_set.lua"
Those are the only real files I have modified so far. I've added the mods mentioned above but that is it.
User avatar
Sutekh
Posts: 127
Joined: Sun Nov 25, 2012 9:58 am
Location: UK

Re: Requesting some specific helpful tips

Post by Sutekh »

As far as I can tell, onDie hooks don't work with grouped monsters like the skeleton_patrol, but only with single monsters?
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Requesting some specific helpful tips

Post by Neikun »

I believe this is correct.
"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!
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: Requesting some specific helpful tips

Post by SpiderFighter »

Sutekh wrote:As far as I can tell, onDie hooks don't work with grouped monsters like the skeleton_patrol, but only with single monsters?
That's absolutley right. I spent hours trying to manipulate them one day in the .lua files and finally realized there's really not much you can do with them grouped.

Code: Select all

cloneObject{
	name = "goro_count",
	baseObject = "goromorg",
	model = "assets/models/monsters/goromorg.fbx",
	health = 400,		-- goromorg shield is on top of this
     onDie = function(self)
     bzbgoroaa:decrement()
   end    
}

     cloneObject{
        name = "soul_scav_count",
        baseObject = "scavenger",
        model = "mod_assets/models/soul_scavenger.fbx",
        animations = {
		(SNIPPED FOR SPACE IN THIS THREAD)	},
        health = 800,
        attackPower = 50,
        evasion = 15,
        exp = 750,
   healthIncrement = 30,
   attackPowerIncrement = 5,
   onDie = function(self)
     bzccountaa:decrement()
     bzccountab:decrement()
     bzccountac:decrement()
   end     }

defineObject{
	name = "skeleton_arch_count",
	class = "Monster",
	model = "mod_assets/models/skeleton_archer_shadow.fbx",
	meshName = "skeleton_archer_mesh",
	animations = {
(SNIPPED FOR SPACE)
	},
	moveSound = "skeleton_walk",
	footstepSound = "skeleton_archer_footstep",
	attackSound = "skeleton_archer_attack",
	hitSound = "skeleton_hit",
	dieSound = "skeleton_die",
	hitEffect = "hit_dust",
	capsuleHeight = 0.7,
	capsuleRadius = 0.25,
	collisionRadius = 0.6,
	health = 600,
	sight = 6,
	attackPower = 45,
	rangedAttack = "frost_arrow",
	coolDown = { 1, 4 },
	protection = 8,
	immunities = { "poison" },
	movementCoolDown = 2,
	noRecoilInterval = { 0.25, 0.5 },
	lootDrop = { 35, "cold_arrow" },
	particleSystem = "death_dust_loop",
	particleSystemNode = "hip", 
	exp = 550,
	healthIncrement = 25,
	attackPowerIncrement = 15,
	brain = "SkeletonArcher",
   	onDie = function(self)
     	bzacountaa:decrement()
   end 
}
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

Part of me was hoping that grouped enemies wasn't the reason, I wanted multiple enemies in this particular claustrophobic room without having the player cornered. I guess I will have to settle for a different enemy instead.

Thanks for the help though, guys. Nearly finished the first floor.
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: Requesting some specific helpful tips

Post by SpiderFighter »

Aleitheo wrote:Part of me was hoping that grouped enemies wasn't the reason, I wanted multiple enemies in this particular claustrophobic room without having the player cornered. I guess I will have to settle for a different enemy instead.

Thanks for the help though, guys. Nearly finished the first floor.
There are plenty of ways to keep combat tough and interesting while still remaining fair. Off the top of my head:
  • Use a "grouped" monster (like the skeleton warriors, or the two archers / scavenegers). --You can still use the Skeleton Warriors farily, depending on how your room is set up.
    Give the player the chance to find a secret area that will open up the space a bit for combat.
    Give them a door they can open/close to control the groups.
    Give them a long corridor to retreat down while fighting.
    Place pits/grating/blockages (crates, statues, et al) that make the monsters take a bit longer to get to the player while he's fighting another monster.
    Teleporters can provide fun ways to get to (or away from) monsters
I'm sure there's more. Congrats on the first level! Feels good, doesn't it? :)
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

This should be the last two things before the dungeon is ready for testing. I have a few secrets in the level, two of which are triggered via pressure plate and it also triggers a script to give the party a set amount of XP. Some of the other secrets however would be more appropriate to be activated once an event is triggered however.

For example, one of my puzzles requires the player place a certain item on an alcove. When the right item is placed it triggers a script which opens some hidden doors. How would I edit the following script to also trigger the secret and the XP script?

Code: Select all

function openSecretDoors()
   for i in LvlOneStorageAlcove:containedItems() do
      if i.name == "legionary_spear"  or i.name == "legionary_shield" then
         LvlOneStorageAlcoveDoor1:toggle()
         LvlOneStorageAlcoveDoor2:toggle()
         LvlOneStorageAlcoveDoor3:toggle()
        break
     end
   end
end
The XP script is as follows. (Posted wrong one, fixed now)

Code: Select all

function exp()   
hudPrint ("250 Party Exp")
 for i=1,4 do  party:getChampion(i):gainExp(250)


    end
end
The second thing is how do I make a script that deletes an item or two (eg: wall button) only when activated (eg: via another button). Basically I want a certain button to no longer trigger when it's purpose has been fulfilled. At the moment I have found the commend that deletes certain objects but don't know how to set it so it only triggers at the appropriate time.
Last edited by Aleitheo on Wed Apr 03, 2013 12:21 am, edited 1 time in total.
Ryeath_Greystalk
Posts: 366
Joined: Tue Jan 15, 2013 3:26 am
Location: Oregon

Re: Requesting some specific helpful tips

Post by Ryeath_Greystalk »

To trigger the secret you could just add the line secret:activate() into your script. So place a secret on the map somewhere and give it a name, say alcove_secret then add

Code: Select all

function openSecretDoors()
   for i in LvlOneStorageAlcove:containedItems() do
      if i.name == "legionary_spear"  or i.name == "legionary_shield" then
         LvlOneStorageAlcoveDoor1:toggle()
         LvlOneStorageAlcoveDoor2:toggle()
         LvlOneStorageAlcoveDoor3:toggle()
         alcove_secret:activate()
        break
     end
   end
end
For giving the characters experience add the line party:getCharacter(1):gainExp(500) --to gain 500 XP.
do this for each character 1-4. So to give all characters 300 XP

Code: Select all

function openSecretDoors()
   for i in LvlOneStorageAlcove:containedItems() do
      if i.name == "legionary_spear"  or i.name == "legionary_shield" then
         LvlOneStorageAlcoveDoor1:toggle()
         LvlOneStorageAlcoveDoor2:toggle()
         LvlOneStorageAlcoveDoor3:toggle()
         alcove_secret:activate()
         party:getCharacter(1):gainExp(300)
         party:getCharacter(2):gainExp(300)
         party:getCharacter(3):gainExp(300)
         party:getCharacter(4):gainExp(300)
        break
     end
   end
end
Now that may cause an issue if a player is using a modified party without 4 players, or if in toruum mode. You could put a check in front of each one to confirm the player is enabled first. Such as,

Code: Select all

if party:getChampion(1):getEnabled() == "true" then
      party:getChampion(1):gainExp(300)
end
My experience with gainExp() is you will need to use hudPrint() to let the player know the experience had been awarded.

Code: Select all

function openSecretDoors()

     local name1 = party:getChampion(1):getName()
    -- repeat 2 - 4

   for i in LvlOneStorageAlcove:containedItems() do
      if i.name == "legionary_spear"  or i.name == "legionary_shield" then
         LvlOneStorageAlcoveDoor1:toggle()
         LvlOneStorageAlcoveDoor2:toggle()
         LvlOneStorageAlcoveDoor3:toggle()
         alcove_secret:activate()
         if party:getChampion(1):getEnabled() == "true" then
                   party:getCharacter(1):gainExp(300)
                   hudPrint(name1.." gained 300 experience.")
         end
       -- repeat for 2 -4
        break
     end
   end
end
*code not tested*
Post Reply