Hello Fellow modders,
I am trying to make this next script run. the numbers 9,10,11 - should open wallgratings simutaniously at the same tick, but I am getting the code wrong I geuss. how do I combine them into one tick?
obviously placing the numbers in brackets does not work... i've also tried {"9,10,11"}, and only "9,10,11",
function dmgrat9tick()
local seq = {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,{9,10,11},}
findEntity("dungeon_wall_grating_"..seq[step]).door:open()
step = step%#seq+1
end
How to make this time ticker work?
- Zo Kath Ra
- Posts: 944
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: How to make this time ticker work?
I don't understand your script 
What is the purpose of the 4's?
It looks like you keep opening "dungeon_wall_grating_4".
What do you want the script to do?
What is the purpose of the 4's?
It looks like you keep opening "dungeon_wall_grating_4".
What do you want the script to do?
Re: How to make this time ticker work?
*Untested!
Code: Select all
function dmgrat9tick()
local seq = { 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
{9,10,11},}
if type(seq[step]) == "table" then
for x = 1,#seq[step] do
findEntity("dungeon_wall_grating_"..seq[step][x]).door:open()
end
else
findEntity("dungeon_wall_grating_"..seq[step]).door:open()
end
step = step%#seq+1
endRe: How to make this time ticker work?
I don't understand your script 
What is the purpose of the 4's?
It looks like you keep opening "dungeon_wall_grating_4".
What do you want the script to do?
each 4 is a tick that opens the same grating (somewhere in nomansland) ... what I need it to do is open the gratings with numbers 9,10,11 .. simultaniously ...but what code do I use for it?
I can get the gratings to open in order if I would do it like this :
4,4,4,4,4,4,4,4,9,10,11, ... but what I want is 9,10,11 to open on the exact same time (the same tick) ... how would I put them together as a group in this script ?
What is the purpose of the 4's?
It looks like you keep opening "dungeon_wall_grating_4".
What do you want the script to do?
each 4 is a tick that opens the same grating (somewhere in nomansland) ... what I need it to do is open the gratings with numbers 9,10,11 .. simultaniously ...but what code do I use for it?
I can get the gratings to open in order if I would do it like this :
4,4,4,4,4,4,4,4,9,10,11, ... but what I want is 9,10,11 to open on the exact same time (the same tick) ... how would I put them together as a group in this script ?
Re: How to make this time ticker work?
kelly1111 wrote:...what I need it to do is open the gratings with numbers 9,10,11 .. simultaniously ...but what code do I use for it?
... how would I put them together as a group in this script ?
Does the script in post #3 [above] not work in the way you need?
(Either in place of, or as an example to look at, and make your own.)