
Ask a simple question, get a simple answer
-
- Posts: 13
- Joined: Wed Feb 04, 2015 9:05 pm
Re: Ask a simple question, get a simple answer
Ahhh I see, ok thanks Isaac I'll check more prudently next time 

-
- Posts: 13
- Joined: Wed Feb 04, 2015 9:05 pm
Re: Ask a simple question, get a simple answer
I just tested it using :isActivated and it works fine. Onto specific item triggers now lol 

- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
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).
Re: Ask a simple question, get a simple answer
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?]
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
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?]
Re: Ask a simple question, get a simple answer
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()
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
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()
-
- Posts: 13
- Joined: Wed Feb 04, 2015 9:05 pm
Re: Ask a simple question, get a simple answer
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
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
Re: Ask a simple question, get a simple answer
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

This is the dungeon alcove version. Should be placed in object.lua
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
},
},
}
-
- Posts: 13
- Joined: Wed Feb 04, 2015 9:05 pm
Re: Ask a simple question, get a simple answer
Ok That looks great. I'm putting all of that into object.lua?
So do I change it to a forest altar by altering the script you gave me to fit what I need?
Thank you so much
So do I change it to a forest altar by altering the script you gave me to fit what I need?
Thank you so much
