Page 3 of 6
Re: General scripting issues and questions
Posted: Sun Sep 16, 2012 5:53 am
by Lmaoboat
New problem:
Things like
Code: Select all
function toxic()
poison1:setParticleSystem("hit_slime")
end
give me "attempt to index global 'fx1' (a nill value) X
But other things like
Code: Select all
function light()
lamp1:toggle()
end
work fine. I checked to make sure the entity ids match, so I'm not sure what it is. the FX activate once when they're on their own in the script, but don't when in a function.
Re: General scripting issues and questions
Posted: Sun Sep 16, 2012 10:18 am
by lowzei
How can you change the lightning (colour, (intensity, range)) of the ceiling lamp?
Re: General scripting issues and questions
Posted: Sun Sep 16, 2012 10:39 am
by Lmaoboat
I think you might have to use an separate fx entity, but I'm not sure.
Re: General scripting issues and questions
Posted: Sun Sep 16, 2012 6:35 pm
by Lmaoboat
So I sort of got it to work using:
Code: Select all
poison1:setParticleSystem("hit_slime")
function toxic()
local poison = findEntity("poison1")
poison:setParticleSystem("hit_slime")
end
But the thing is that it only works if I use the toxic function while the particle effect is on the screen. So use it after the particle animation is finished, it'll come back with that error still.
Re: General scripting issues and questions
Posted: Sun Sep 23, 2012 2:12 pm
by Whalefish
I've never done lua (or almost any scripting/coding) before, just copying from other peoples scripts and trying to learn from them. So I'm basically a noob, explain everything
I tried searching, but couldn't find answers to few questions:
1st:
Is it possible to create a stack of arrows in to an alcove?
In example:
local arrowSack = spawn("sack")
arrowSack:addItem(spawn("arrow"))
arrowAlcove:addItem(arrowSack)
How do I change the arrow to a stack of 4 arrows?
2nd:
Is it possible to remove things from my map with scripting? Like lights?
Most likely I will come back with more questions later
Re: General scripting issues and questions
Posted: Sun Sep 23, 2012 9:34 pm
by zeltak
Is there a way to remove torches from holders via script or some other way to shut them down?
Re: General scripting issues and questions
Posted: Sun Sep 23, 2012 10:10 pm
by Montis
I don't think so.
Re: General scripting issues and questions
Posted: Mon Sep 24, 2012 8:53 am
by zeltak
Is there a way to test on what level the party is on? Or do you have suggestions how to control the monster population on a level? I mean atm I have couple of spawners pumping monsters out in a regular basis with a timer, as the level itself is pretty hard to control with just the spawning from hidden pressure plates. If you have an example I would be most thankful as my scripting skills are still on pretty low level
Re: General scripting issues and questions
Posted: Mon Sep 24, 2012 9:08 am
by Lmaoboat
Code: Select all
function levelcheck()
if party.level == x then
end
And connect it to a timer.
Re: General scripting issues and questions
Posted: Mon Sep 24, 2012 10:25 am
by zeltak
Thank you!