Check altar for correct item to trigger connection

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Check altar for correct item to trigger connection

Post by Emera Nova »

What would the script be for an altar to check for a certain item being placed on it's surface? I have part of my dungeon set up so that when an item is placed on an altar it puts up a force field and then that item later gets a stat change after a boss fight finishes. What I'm worried about is if the player places any item on the altar as it is right now it will still trigger the forcefield and let them move on with the room which will lead to the script running into an error because the party holds the item that was suppose to be on the table.
Eburt
Posts: 69
Joined: Thu Feb 05, 2015 5:44 am

Re: Check altar for correct item to trigger connection

Post by Eburt »

Watch part 10 of Skuggasveinn's editor tutorials, specifically the figurine puzzle.

Then adjust the scripts to work with your specific item and altar (the surface component in the altar works the same as for an alcove).
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re: Check altar for correct item to trigger connection

Post by Emera Nova »

Im attempting to get it to activate or deactivate a forcefield and teleporter. What is the line that I need to put in after their name and before the :activate part?

Like doors have .door, and floortriggers have .floortrigger..

Is the forcefields just .forcefield? or teleporters being .teleporter?
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: Check altar for correct item to trigger connection

Post by Isaac »

Emera Nova wrote:Im attempting to get it to activate or deactivate a forcefield and teleporter. What is the line that I need to put in after their name and before the :activate part?

Like doors have .door, and floortriggers have .floortrigger..

Is the forcefields just .forcefield? or teleporters being .teleporter?
A quick rule of thumb is to select an object in the editor, and you will see its components.

Forcefield does have a forcefield component, but it also has a controller component.
The controller is the one you want. It has the activate/deactivate methods.

force_field_1.controller:deactivate()
BlankGame
Posts: 2
Joined: Thu Dec 01, 2016 7:06 pm

Re: Check altar for correct item to trigger connection

Post by BlankGame »

i cant code is there any other way???
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Check altar for correct item to trigger connection

Post by THOM »

BlankGame wrote:i cant code is there any other way???
nope :?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Lark
Posts: 178
Joined: Wed Sep 19, 2012 4:23 pm
Location: Springfield, MO USA

Re: Check altar for correct item to trigger connection

Post by Lark »

BlankGame: Coding is like anything else - start slow, put out a little effort, and learn as you go on simple programs. PM me if you want some assistance. I'll be happy to help you get started. I only have a little coding experience with Lua under Grimrock, but even a little knowledge can be rewarding. The language itself isn't too bad to pick up once you know a few general programming concepts. Frankly, learning all of the Grimrock methods, constructs, built-in features, et cetera will take the most time and I only know a little about those unlike several others on these forums who appear very well versed in them. And they have left a wealth of knowledge on these forums if we'll spend a little time digging it out.

Take care, -Lark
Post Reply