Re: Requestion some specific helpful tips
Postby Ryeath_Greystalk ยป Fri Mar 22, 2013 8:35 pm
Aleitheo,
In the dungeon I am working on I have a room that may be similar to what you are trying to accomplish. There are probably a few ways to do it but I will explain how I managed to accomplish it.
In my room i have a door which I named OfficeDoor1 and a secret door named OfficeDoor2. The layout is simple, when the party walks in a hidden pressure plate closes the door behind them. Once the party accomplishes a particular task in the room I then have 4 snails spawn in, one in each corner. The snails are custom assets using the cloneObject() function.
To clone the snails you would go into your dungeons Mod_Assets/scripts/monsters folder and add the following text.
Code: Select all
cloneObject{
name = "officesnail",
baseObject = "snail",
onDie = function(self)
OfficeCounter:decrement()
end,
}
This will create a copy of the snail and name it officesnail. You could name yours something else, such as doorsnail, or funny_looking_snail etc. It will keep all the same attributes as the regular snail, but with the addition of the onDie hook. The onDie hook will cal a function when the snail dies. In this case I have a counter, named OfficeCounter, that will decrement by 1 when the snail dies.
If you take this code and put it in your Mod_Assets/Scripts/Monsters file and save it, then reload your dungeon in the editor, you should now find an officesnail in your entities list (or whatever you named yours.) If you wanted to use a herder just change the baseObject to herder etc.. Just be sure you put a counter in the dungeon with the same name as what you use i the monsters onDie function or the game will crash.
getting back to my room, once the 4 snails spawn, each time one is killed the counter goes down by 1 untill the last one dies and the counter hits 0.
When the counter hits 0, 3 things happen ( I have the counter connected to 3 items), 1 the door named OfficeDoor2 opens up, 2 a spawner behind that door spawns a mini boss herder, 3 a script prints some gibberish on the screen to make it look like the herder is saying something in mushroom language.
the miniboss herder is again a cloned monster. I use this text
Code: Select all
cloneObject{
name = "officeherder",
baseObject = "herder",
health = 250,
onDie = function(self)
OfficeDoor1:open()
end,
}
Here I copied a herder but just gave it more life to make a little bit longer fight. Notice I also used an onDie hook so that when the miniboss dies the OfficeDoor1 that the party came in through opens up and they can go about thier dungeon exploring. Agai yo can copy that to the monsters file, save it and reload the dungeon and the officeherder should show up in the entities list.
There you have examples of how using the onDie hook with a cloned monster can create siffect results in the game.
A valuable tool is to download the assets pack that lists what the default assets used in the game are. That can be found here
http://www.grimrock.net/modding/asset-pack/ (big thank you goes out to komag and Neikun for showing me the way there) For example I wanted to make a swarm of spiders, but make them weaker than normal, so I just looked up spider in the assets pack, saw what the regular specs are and changed mine to this
Code: Select all
cloneObject{
name = "weakspider",
baseObject = "spider",
health = 50,
attackPower = 12,
accuracy = 3,
exp = 25,
}
If you compare to the standard spider I lowered the health, attackPower, accuracy and of course the exp. These are for more to establish a panic in the player when this swarm comes at them at a time when a normal spider is a tough fight.
One thing to mention with the way I use the onDie hook to decrement the counter. For some wierd reason if you use kill the monster using the 'K' key, the counter will decrement but it won't trigger the effect. You have to physically kill the snail just like in the real game. You can read about it here viewtopic.php?f=14&t=5090
Also I mention a 3rd item when the snails all die. I link the counter to a script, and on the script I have this
Code: Select all
function angryMushroom()
hudPrint("\"Harg arlu nago inagoa ish!")
hudPrint("Nago lugah raga ISHGANU!!!\"")
end
This just prints some gibberish on the screen.
Hope some of this helps. I came here nowing next to nothing about this stuff and I have learned a lot just reading these forums. There is a ton of good info here.
Good luck