Page 3 of 4

Re: Requesting some specific helpful tips

Posted: Fri Mar 29, 2013 2:17 am
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?

Re: Requesting some specific helpful tips

Posted: Fri Mar 29, 2013 3:25 am
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.

Re: Requesting some specific helpful tips

Posted: Sun Mar 31, 2013 12:06 am
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.

Re: Requesting some specific helpful tips

Posted: Sun Mar 31, 2013 12:28 am
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?

Re: Requesting some specific helpful tips

Posted: Sun Mar 31, 2013 12:29 am
by Neikun
I believe this is correct.

Re: Requesting some specific helpful tips

Posted: Sun Mar 31, 2013 12:25 pm
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 
}

Re: Requesting some specific helpful tips

Posted: Mon Apr 01, 2013 11:03 pm
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.

Re: Requesting some specific helpful tips

Posted: Tue Apr 02, 2013 12:08 am
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? :)

Re: Requesting some specific helpful tips

Posted: Tue Apr 02, 2013 2:41 am
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.

Re: Requesting some specific helpful tips

Posted: Tue Apr 02, 2013 8:48 pm
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*