General scripting issues and questions

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: General scripting issues and questions

Post 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.
lowzei
Posts: 99
Joined: Tue Mar 27, 2012 12:00 pm

Re: General scripting issues and questions

Post by lowzei »

How can you change the lightning (colour, (intensity, range)) of the ceiling lamp?
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: General scripting issues and questions

Post by Lmaoboat »

I think you might have to use an separate fx entity, but I'm not sure.
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: General scripting issues and questions

Post 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.
Whalefish
Posts: 15
Joined: Fri Mar 30, 2012 5:51 pm

Re: General scripting issues and questions

Post 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 :)
Last edited by Whalefish on Mon Sep 24, 2012 7:39 am, edited 2 times in total.
User avatar
zeltak
Posts: 119
Joined: Fri May 04, 2012 2:33 am

Re: General scripting issues and questions

Post by zeltak »

Is there a way to remove torches from holders via script or some other way to shut them down?
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: General scripting issues and questions

Post by Montis »

I don't think so.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
zeltak
Posts: 119
Joined: Fri May 04, 2012 2:33 am

Re: General scripting issues and questions

Post 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 :oops:
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: General scripting issues and questions

Post by Lmaoboat »

Code: Select all

function levelcheck()
if party.level == x then 

end
And connect it to a timer.
User avatar
zeltak
Posts: 119
Joined: Fri May 04, 2012 2:33 am

Re: General scripting issues and questions

Post by zeltak »

Thank you!
Post Reply