Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
What i'm looking for is to get that "+" sign, that lets you add connectors (inside the editor) to a component, to work on a ControllerComponent.
Same as you have on for example a LeverComponent.
For now i am using a LeverComponent instead of a ControllerComponent. but then i need to add an dummy animation, that returns false. Also i get warnings when i don't have an model.
This is just something minor but wanted to ask in case I missed something.
Same as you have on for example a LeverComponent.
For now i am using a LeverComponent instead of a ControllerComponent. but then i need to add an dummy animation, that returns false. Also i get warnings when i don't have an model.
This is just something minor but wanted to ask in case I missed something.
Re: Ask a simple question, get a simple answer
This functionality doesn't exist. ControllerComponent doesn't have any connector events. However, instead of using LeverComponent for your hack, you should just use CounterComponent.Hei&Yin wrote:What i'm looking for is to get that "+" sign, that lets you add connectors (inside the editor) to a component, to work on a ControllerComponent.
Same as you have on for example a LeverComponent.
For now i am using a LeverComponent instead of a ControllerComponent. but then i need to add an dummy animation, that returns false. Also i get warnings when i don't have an model.
This is just something minor but wanted to ask in case I missed something.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Is it possible to test the existence of a file or list the content of a directory ? Still learning Lua, I just found that the standard io library is unknown in grimrock scripting ?
Re: Ask a simple question, get a simple answer
No. If it were, it would be an enormous security hole.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Security holes are fun !!! I was trying to access the portraits directory to populate taverns with generated recruitable champions.
Re: Ask a simple question, get a simple answer
Ok i am trying to call a function inside a script_entity form another script_entity but cannot get it to work...
Example:
script_entity_1
script_entity_2
I get error attempt to call field 'fireAway' (a nil value)
What am i doing wrong??
Example:
script_entity_1
Code: Select all
function startSequence()
print("Sequence started...")
delayedCall(self.go.id, 1, "sfireball")
delayedCall(self.go.id, 1.5, "firstEvent")
delayedCall(self.go.id, 10, "secondEvent")
end
function firstEvent()
print("This script is run 1.5 seconds after the start.")
end
function secondEvent()
print("This is printed 10 seconds after start.")
end
function sfireball()
script_entity_2.fireaway() -- This is where i get an error
end
Code: Select all
function fireAway()
spawn("fireball_small",1,14,15,1,0)
end
What am i doing wrong??
Re: Ask a simple question, get a simple answer
script_entity_2.script.fireAway() not script_entity_2.fireaway()
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
so i forgot to tell it that it was a script xxxx.script.xxxx()minmay wrote:script_entity_2.script.fireAway() not script_entity_2.fireaway()
thanks
Re: Ask a simple question, get a simple answer
This is because the *.script is a script component in the object.sajon wrote:so i forgot to tell it that it was a script xxxx.script.xxxx()minmay wrote:script_entity_2.script.fireAway() not script_entity_2.fireaway()
thanks
Re: Ask a simple question, get a simple answer
So my scripting is not that good....
i am trying to reset a series of pressure plates
allPlates is the ID's of my pressure plates.
I want to just enable all those plates by a trigger, but i also want to figure out how to use an array to store variables to use in loops.
Here is the code i am trying to get to work but it won't.
Thanks for the help...
i am trying to reset a series of pressure plates
allPlates is the ID's of my pressure plates.
I want to just enable all those plates by a trigger, but i also want to figure out how to use an array to store variables to use in loops.
Here is the code i am trying to get to work but it won't.
Code: Select all
function Plates()
local allPlates = {"T1_Plate1", "T1_Plate2", "T1_Plate3", "T1_Plate4", "T1_Plate5", "T1_Plate6", "T1_Plate7", "T1_Plate8", "T1_Plate9", "T1_Plate10"}
--print (allPlates)
for i=1,10 do allPlates[i].floortrigger:enable(true)
end
end