New at scripting; have simple question - sack in alcove?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

New at scripting; have simple question - sack in alcove?

Post by CB85 »

I, for the life of me, cannot figure out how to script a sack onto an alcove and to have it contain items. How would I manage this?

I am entirely new at Lua scripting; I just really want to try my hand at this because I like this game quite a bit.

Thank you in advance for any help you folks might throw my way.
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

Re: New at scripting; have simple question

Post by CB85 »

And for the record, I've been through the "useful scripts" thread; if the answer is in there I simply did not understand it. It seems to be a fantastic resource for someone just starting out, like myself.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: New at scripting; have simple question

Post by Komag »

I've answered this by adding this script here:
viewtopic.php?p=36117#p36117
Finished Dungeons - complete mods to play
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

Re: New at scripting; have simple question - sack in alcove?

Post by CB85 »

Thank you!
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

Re: New at scripting; have simple question - sack in alcove?

Post by CB85 »

I come bearing another question -- I thought it'd be okay to re-use this thread to post it. If it isn't, I apologize in advance -- I know some forums prefer this sort of thing another way.

I'm trying to code a button at the end of a puzzle sequence; I haven't used any Lua scripting in this puzzle at all, and what I have so far is a hallway - pressure switch at the start - which activates three pitfalls on a timer, as well as a fireball-spewing trap.

I have a button at the end of this hallway that deactivates the timer as well as the fireball trap; what I can't figure out how to do is getting it to lock the pitfall traps in their closed position.

Again, thank you for the help I've already received and thank you in advance for any help or consideration you may offer in solving this.
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

Re: New at scripting; have simple question - sack in alcove?

Post by CB85 »

I was actually able to figure this one out by myself! For anyone else wondering the same, the solution is as simple as the following image demonstrates:

http://i.imgur.com/gC7el.png

As you can see, the timer can be deactivated and the trap doors can all be closed with just the button and the use of connectors -- no scripting required!
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

Re: New at scripting; have simple question - sack in alcove?

Post by CB85 »

Okay -- chapter 3 in the Newbie's Dungeon Creation Saga. If I could re-title this thread that, I would; I continue this anthology while thinking that other new people will likely have the same issues. On with the plot:

Grates.. Grates everywhere. These things appear where I do not want them and I do not know how to remove them; I was able to get some to disappear by placing a room far away, and that doesn't make much sense to me. Their placement seems random. If I could remove them on an individual basis, my problems here would be solved.

I searched 'grate' on this forum and I didn't find instructions on how to do this, for what that's worth. Again, thank anyone and everyone for any help or consideration you put forth.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: New at scripting; have simple question - sack in alcove?

Post by Komag »

Yes they're random, set to a certain percentage of floor tiles (along with wall hooks, chains, pillar rings, wall floor-drains, etc. Ivy and floor dirt used to be this way, but they kept getting in the stairwells floating, so petri removed them from the default mix)

You can control everything if you want to, by defining a custom wall set that doesn't include them. I've personally defined a custom wall set for the exact purpose you want, to get rid of random floor drainages so I can place them manually. All you need to do is copy the default and set the line about floor_drainage to 0
Finished Dungeons - complete mods to play
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: New at scripting; have simple question - sack in alcove?

Post by Komag »

Here is a copy of my entire wall_sets.lua just in case it helps: (found in Documents\Almost Human\Legend of Grimrock\Dungeons\dungeonName\mod_assets\scripts)

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.1

-- TODO: place your custom wall set definitions here
defineWallSet{
	name = "dungeon2",
	randomFloorFacing = true,

	floors = {
		"assets/models/env/dungeon_floor_01.fbx", 5,
		"assets/models/env/dungeon_floor_02.fbx", 5,
		"assets/models/env/dungeon_floor_03.fbx", 5,
		"assets/models/env/dungeon_floor_04.fbx", 5,
		"assets/models/env/dungeon_floor_05.fbx", 5,
		"assets/models/env/dungeon_floor_06.fbx", 5,
		"assets/models/env/dungeon_floor_drainage.fbx", 0,
	},

	walls = {
		"assets/models/env/dungeon_wall_01.fbx", 50,
		"assets/models/env/dungeon_wall_drainage.fbx", 1,
	},

	pillars = {
		"assets/models/env/dungeon_pillar.fbx", 1,
	},

	ceilings = {
		"assets/models/env/dungeon_ceiling.fbx", 1,
	},

	ceilingShafts = {
		"assets/models/env/dungeon_ceiling_pit.fbx", 1,
	},

	floorDecorations = {
	},

	wallDecorations = {
		"assets/models/env/metal_hooks_wall.fbx", 1,
		"assets/models/env/metal_hooks_chain_wall.fbx", 1,
	},

	pillarDecorations = {
		"assets/models/env/metal_hook_pillar.fbx", 1,
		"assets/models/env/metal_hook_chain_pillar.fbx", 1,
		"assets/models/env/metal_ring_pillar.fbx", 1,
	},
}
Finished Dungeons - complete mods to play
CB85
Posts: 7
Joined: Sat Oct 06, 2012 11:37 am

Re: New at scripting; have simple question - sack in alcove?

Post by CB85 »

Again, thank you. I really appreciate the help with this.

I hope it isn't out of turn if I keep posting to this thread if I have any further questions. The assistance I'm getting here is just great!
Post Reply