It is the map entry for the image. If you post the script at the end of dungeon.lua [and save the file], it will write that map image into the next level on your map.Glew wrote:Yes, something like this but on a much smaller scale. Actually 3 rooms like those, so 11X11 tiles for this "maze", not counting the secret passage that leads out of it.
But I'm not sure what that script you posted is all about...
[mod-wip] Treasury - General Help Me
Re: [mod-wip] Treasury - General Help Me
Re: [mod-wip] Treasury - General Help Me
And that will also take care of the textures?Isaac wrote: It is the map entry for the image. If you post the script at the end of dungeon.lua [and save the file], it will write that map image into the next level on your map.
Re: [mod-wip] Treasury - General Help Me
Nope... it just writes the layout; when you mentioned a repeating room, I remembered working on one, and found the layout script for it. However with a custom wallset you can remove wall and drains.Glew wrote:And that will also take care of the textures?Isaac wrote: It is the map entry for the image. If you post the script at the end of dungeon.lua [and save the file], it will write that map image into the next level on your map.
You mentioned since, of it being a small room instead. for that my first post would be the best solution I think. Define decoration objects for a floor, wall, and ceiling. Use the official game models for those, and place them in your map where the random embellishment mustn't appear.
Re: [mod-wip] Treasury - General Help Me
Isaac wrote:The way that I have done this is to define the specific custom architectural objects I needed and place them where the dungeon should never be random. This includes floors, pillars, and walls; possibly ceilings. I had a balcony that would spawn drains in the floor, and had to place custom tiles set to replace the floor.
I don't want to be annoyingly stupid, but this doesn't give me too much... How do I do this? I am _very_ inexperienced in any kind of scripting, programming. What does "defining specific custom architectural objects" mean? How is it different from Skuggasveinn's suggestion. Is that not defining a custom wallset?You mentioned since, of it being a small room instead. for that my first post would be the best solution I think. Define decoration objects for a floor, wall, and ceiling. Use the official game models for those, and place them in your map where the random embellishment mustn't appear.
And anyway, how do I do any of this step by step, please? What file do I modify and how etc.?
Thanks.
Re: [mod-wip] Treasury - General Help Me
Sure.Glew wrote:Isaac wrote:The way that I have done this is to define the specific custom architectural objects I needed and place them where the dungeon should never be random. This includes floors, pillars, and walls; possibly ceilings. I had a balcony that would spawn drains in the floor, and had to place custom tiles set to replace the floor.I don't want to be annoyingly stupid, but this doesn't give me too much... How do I do this? I am _very_ inexperienced in any kind of scripting, programming. What does "defining specific custom architectural objects" mean? How is it different from Skuggasveinn's suggestion. Is that not defining a custom wallset?You mentioned since, of it being a small room instead. for that my first post would be the best solution I think. Define decoration objects for a floor, wall, and ceiling. Use the official game models for those, and place them in your map where the random embellishment mustn't appear.
And anyway, how do I do any of this step by step, please? What file do I modify and how etc.?
Thanks.
The first thing you should do is download the Grimrock asset pack. This give you access to all of Grimrock's public assets, and lets you study its scripts and a copy of its internal file system. Everything listed in the asset pack, exists in the game under the path "assets/"; where as user mod files exist under the path "mod_assets/". A modder can refer to grimrock internal assets by using the path seen in the extracted asset pack from AH. These files do not have to be included in your mod, as they are used in the base game.
Once you have the asset pack extracted (somewhere convenient), navigate to the scripts folder and you will see the heart of the game's assets defined in the scripts contained. Open the 'objects.lua' file to see all of the dungeon's architectural features defined. This is what the game reads to create the assets it uses to display the game maps.
In your mod folder [default: (in your document folder) is 'Almost Human/dungeons/%name of your mod%'], there is a scripts folder that has several blank scripts by default. You can open any of these and define new assets using the same format as seen in the asset pack's scripts, and those items will exist in the editor (once perfectly defined ~without syntax or path errors ).
To define a new floor [for instance], you would follow the format seen in the asset pack script for the floor; just copy/paste the entry initially, and change the name.
Search the object.lua file for a floor decoration... like the drain; a search for "dungeon_floor_drainage", reveals this entry:
Code: Select all
defineObject{
name = "dungeon_floor_drainage",
class = "Decoration",
model = "assets/models/env/dungeon_floor_drainage.fbx",
placement = "floor",
replacesFloor = true,
editorIcon = 136,
}Change the line: name = "dungeon_floor_drainage",
to: name = "my_custom_floorTile",
Then change the line: model = "assets/models/env/dungeon_floor_01.fbx",
- [Or use "assets/models/env/temple_floor_01.fbx" instead; this will make it easy to see on the floor using the dungeon wallset.]
* A quirk that you'll need to know is that the model assets in the asset pack are stored in AH's .model format, but in scripts, they must be referred to as .fbx files.
- So the file "dungeon_floor_01.fbx" actually exists in the asset pack as "dungeon_floor_01.model".
**Because we didn't change the icon in the definition, the custom floor tile displays with a drain icon in the editor.
A handy utility to actually view the model files in the asset pack is John Wordsworth's Grimrock Model Toolkit.
http://www.johnwordsworth.com/legend-of ... l-toolkit/
Re: [mod-wip] Treasury - General Help Me
Thanks for the detailed reply.
Re: [mod-wip] Treasury - General Help Me
I have no idea how to even search for this so I'm going to ask:
Is there a way... What is the way to check for a specific spell being cast at a specific place? This is to work around the annoying fact that receptors only accept projectile spells.
Basically I want a door to be opened by fireburst being cast "at" a specific wall (well, practically being cast in the cell in front of the wall). I may just work out an other puzzle, but I like this idea.
Thanks as always.
edit: Arrrg! I'm going nuts! How do I delay a script? For example can I make a for loop to have a slight delay between each loop? I want to play a sound 3 times.
This does not work:
What happens I guess is the sound gets played 3 times simultaneously, so it overlaps with itself.
I want something like this
I know I've read about something like this somewhere but can't find it. And now I'm too tired to even think about a work-around with timers.
Is there a way... What is the way to check for a specific spell being cast at a specific place? This is to work around the annoying fact that receptors only accept projectile spells.
Basically I want a door to be opened by fireburst being cast "at" a specific wall (well, practically being cast in the cell in front of the wall). I may just work out an other puzzle, but I like this idea.
Thanks as always.
edit: Arrrg! I'm going nuts! How do I delay a script? For example can I make a for loop to have a slight delay between each loop? I want to play a sound 3 times.
This does not work:
Code: Select all
function alarmsound()
for i=1,3 do
playSound("impact_blade")
end
endI want something like this
Code: Select all
function alarmsound()
for i=1,3 do
playSound("impact_blade")
[wait_a_second] -- somehow make it wait 1 second before restarting the loop
end
endRe: [mod-wip] Treasury - General Help Me
Code: Select all
--[[
Place this script on the map, and call it from your script, or a floor_trigger.
Call or connect to the soundDelay() function.
You can change the values of delay and sound2Play to the delay and the
sound sample that you wish to use.
You can optionally call the function with arguments; like this:
%replace with Object name%.script.soundDelay("secret",1)
example: mySoundDelay.script.soundDelay("secret",1)
--]]
--{default options}============================
delay = 1
sound2Play = "impact_blade"
--===========================================
function soundDelay(optSound2Play, optDelay)
if optSound2Play and optDelay then
sound2Play, delay = optSound2Play, optDelay
end
local sTimer = spawn ("timer", party.level, 1,1,1,1).timer
sTimer:setTimerInterval(delay)
sTimer:setDisableSelf(true)
sTimer:addConnector("onActivate", self.go.id , "play" )
sTimer:start()
end
function play(caller)
playSound(sound2Play)
caller.go:destroy()
endRe: [mod-wip] Treasury - General Help Me
Thanks for the help. But actually after giving it some rest it occured to me that I can just place a counter and a timer, connect them that the timer decreases the counter and triggers the playsound() and the counter deactivates the timer and then I just need to activate the timer.
I finally have time to actually work through the coding of the first major puzzle. I hope it'll work. It seems that I have finally figured out everything it needs. Not really sure if it will be elegant or bug-safe, but we'll see.
edit:
And it works! The first puzzle is finally doable. After much frustration and some compromising...
I finally have time to actually work through the coding of the first major puzzle. I hope it'll work. It seems that I have finally figured out everything it needs. Not really sure if it will be elegant or bug-safe, but we'll see.
edit:
And it works! The first puzzle is finally doable. After much frustration and some compromising...
Re: [mod-wip] Treasury - General Help Me
So I have made some progress with the map, but had to put it to rest, because of work and school.
But I have got an idea and ran into a problem. It seems that scripts can't find items within the inventory: they return nil. I think I read about this somewhere but couldn't find it.
Is there a way to access items that are in the inventory? From the scripting reference it seems there is a way to access items in equipemnt slots with Champion:getItem(slot). But what about non-equipped items? I guess party:getChampion(1):containedItems() won't work, would it?
But I have got an idea and ran into a problem. It seems that scripts can't find items within the inventory: they return nil. I think I read about this somewhere but couldn't find it.
Is there a way to access items that are in the inventory? From the scripting reference it seems there is a way to access items in equipemnt slots with Champion:getItem(slot). But what about non-equipped items? I guess party:getChampion(1):containedItems() won't work, would it?