Re: Ask a simple question, get a simple answer
Posted: Sun Feb 08, 2015 11:16 pm
Ahhh I see, ok thanks Isaac I'll check more prudently next time 

Official Legend of Grimrock Forums
http://mail.grimrock.net/forum/
What exactly are you trying to do? (Or, what specifically do you need done?)AndakRainor wrote:Is it possible to loop through all spells definitions ? I would like to generate automatically all the corresponding scrolls rather than define them individually (and I have a ton of spells).
Oh sorry ! It is not about spawning anything that's why I'm a little lost... I defined a lot of spells, and I need to define all the corresponding scrolls. I wondered if there was an easy way to do it or if I needed to write each definition individually (long task in perspective). I know how to manipulate entities or components but what about definitions themselves ?Isaac wrote:What exactly are you trying to do? (Or, what specifically do you need done?)AndakRainor wrote:Is it possible to loop through all spells definitions ? I would like to generate automatically all the corresponding scrolls rather than define them individually (and I have a ton of spells).
Are you trying to 'loop through' a list of currently defined spells?, or trying to spawn a collection of scrolls? [..in an alcove?]
There is.AndakRainor wrote:Oh sorry ! It is not about spawning anything that's why I'm a little lost... I defined a lot of spells, and I need to define all the corresponding scrolls. I wondered if there was an easy way to do it or if I needed to write each definition individually (long task in perspective). I know how to manipulate entities or components but what about definitions themselves ?
Code: Select all
function makeScrolls()
...
end
makeScrolls()
Thanks ! So any idea how I could access all the spells definitions in this function and for each get its name and uiName (the two values necessary to define a spell scroll) ?Isaac wrote:There is.AndakRainor wrote:Oh sorry ! It is not about spawning anything that's why I'm a little lost... I defined a lot of spells, and I need to define all the corresponding scrolls. I wondered if there was an easy way to do it or if I needed to write each definition individually (long task in perspective). I know how to manipulate entities or components but what about definitions themselves ?
You are free to create & call functions in the initial scripts.
You could do something like this [pseudo]:Code: Select all
function makeScrolls() ... end makeScrolls()
rlewarne04 wrote:Hi guys
I've been trying for hours to get a script to work in which a Skull placed on a forest altar will trigger a teleporter to activate. Simple if done using connectors, I know. But I only want it to activate the teleporter with the skull and have nothing happen with any other item placed on it. I've looked in the scripting reference and tried different methods and I even watched an alcove puzzle tutorial and tried to make it work with this but it didn't and I'm sure I'm either missing something very simple or very obvious.
Maybe one of you could help me write a script to make it possble?
Thanks in advance
Code: Select all
defineObject{
name = "dungeon_skull_alcove",
baseObject = "base_alcove",
components = {
{
class = "Model",
model = "assets/models/env/dungeon_wall_alcove.fbx",
staticShadow = true,
},
{
class = "Occluder",
model = "assets/models/env/dungeon_wall_alcove_occluder.fbx",
},
{
class = "Surface",
offset = vec(0, 0.85, 0.2),
size = vec(1.3, 0.65),
onInsertItem = function(self, item)
if item.go.name == "skull" then
skull_teleporter_1.controller:activate() -- This MUST match the name of your teleporter. In this case the name is "skull_teleporter_1"
end
end
},
},
}