isn't it possible to make a loop within a loop? or am i just stupid i tried to make a script to clear an area:
func onTrigger(int global, int x, int y, int z, int random)
int a=0,b=0,c=0
while a<3
while b<3
while c<3
BlockPos(x-a+1, y-b+1, c+1, 1)
BlockDel()
c=c+1
endwhile
c=0
b=b+1
endwhile
b=0
a=a+1
endwhile
return 0
endfunc
But every time i run it, it just ends in Minecraft "crashing"
Dude your CPU Block has enough functions to make a snake game inside minecraft but there is a problem. HOW THE HELL DO I CONTROL THE SNAKE? The CPU Block needs more inputs or a way to get the IDs of the Blocks.
for example:getBlockID(x ,y ,z) returns the block id at those coordinates
maybe even metadata? :biggrin.gif: (these thingys that make the wool coloured and the redstone red(metadata is only 4 bit(a number between 0 and 15 could be stored with it(0 means unpowered and metadata > 0 means powered(actually i'm just guessing)))))
and add to BlockPos(int X, int Y, int Z, int BlockID)
a version that let's you change the metadata of blocks to make coloured wool
multiple cpus? for movement i would say pressure plates
Dude your CPU Block has enough functions to make a snake game inside minecraft but there is a problem. HOW THE HELL DO I CONTROL THE SNAKE? The CPU Block needs more inputs or a way to get the IDs of the Blocks.
for example:getBlockID(x ,y ,z) returns the block id at those coordinates
maybe even metadata? :biggrin.gif: (these thingys that make the wool coloured and the redstone red(metadata is only 4 bit(a number between 0 and 15 could be stored with it(0 means unpowered and metadata > 0 means powered(actually i'm just guessing)))))
and add to BlockPos(int X, int Y, int Z, int BlockID)
a version that let's you change the metadata of blocks to make coloured wool
multiple cpus? for movement i would say pressure plates
multiple cpus but how ? there is no kind of global variable that is usable on multiple cpus but if there was one that would work
EDIT: i don't like the while loop anymore cause using functions that call each other worked without problems(i got stairs instead of walls but it's at least working)
Dude your CPU Block has enough functions to make a snake game inside minecraft but there is a problem. HOW THE HELL DO I CONTROL THE SNAKE? The CPU Block needs more inputs or a way to get the IDs of the Blocks.
for example:getBlockID(x ,y ,z) returns the block id at those coordinates
maybe even metadata? :biggrin.gif: (these thingys that make the wool coloured and the redstone red(metadata is only 4 bit(a number between 0 and 15 could be stored with it(0 means unpowered and metadata > 0 means powered(actually i'm just guessing)))))
and add to BlockPos(int X, int Y, int Z, int BlockID)
a version that let's you change the metadata of blocks to make coloured wool
multiple cpus? for movement i would say pressure plates
multiple cpus but how ? there is no kind of global variable that is usable on multiple cpus but if there was one that would work
EDIT: i don't like the while loop anymore cause using functions that call each other worked without problems(i got stairs instead of walls but it's at least working)
uhhh i dont know i like i said dont know java or stuff like that but if they add the ability to link cpus or choose which side of cpu for the input for certain sides of the scripts. why must everyone know java but me :sad.gif:
edit: share ur script ur code might (if biohazard likes it) be used to make games
-snip-
EDIT: i don't like the while loop anymore cause using functions that call each other worked without problems(i got stairs instead of walls but it's at least working)
would you like to share the script? :tongue.gif:
remove the comments and the script will run fine
func onTrigger(int global, int x, int y, int z, int random)
int a=16 // should give me a 16x16 wall but it doesn't
Loop(x+1,y,z,42,0,a,a) // 42 is the block id(iron block)
return 1
endfunc
func Loop(int x, int y, int z, int ID, int c,int mx,int my)
Loop2(x,y,z,ID,c,mx,my)
if c==mx then return 1
c=c+1
x=x+1
return Loop(x,y,z,ID,c,mx,my)
endfunc
func Loop2(int x, int y, int z, int ID, int c,int mx,int my)
BlockPos(x,y,z,ID)
BlockSpawn()
if c==my then return 1
c=c+1
y=y+1
return Loop2(x,y,z,ID,c,mx,my)
endfunc
here's the preview(the wallthingy behind is a stair that is 48 blocks high)
feel free to make it working right :biggrin.gif:
Ive fixed it:
func onTrigger(int global, int x, int y, int z, int random)
int a=16
Loop(x+1,y,z,42,0,0,a,a)
return 1
endfunc
func Loop(int x, int y, int z, int ID, int c,int d,int mx,int my)
Loop2(x,y,z,ID,c,d,mx,my)
if c==mx then return 1
c=c+1
x=x+1
return Loop(x,y,z,ID,c,d,mx,my)
endfunc
func Loop2(int x, int y, int z, int ID, int c,int d,int mx,int my)
BlockPos(x,y,z,ID)
BlockSpawn()
if d==my then return 1
d=d+1
y=y+1
return Loop2(x,y,z,ID,c,d,mx,my)
endfunc
func onTrigger(int global, int x, int y, int z, int random)
int a=10
LoopX(x-a,y,z-a,-a,-a,-a,a,a)
return 1
endfunc
func LoopX(int x, int y, int z, int c,int d,int e,int mx,int mz)
LoopY(x,y,z,c,d,e,mx,mz)
if c==mx then return 1
c=c+1
x=x+1
return LoopX(x,y,z,c,d,e,mx,mz)
endfunc
func LoopY(int x, int y, int z, int c,int d,int e,int mx,int mz)
LoopZ(x,y,z,c,d,e,mx,mz)
if d==128 then return 1
d=d+1
y=y+1
return LoopY(x,y,z,c,d,e,mx,mz)
endfunc
func LoopZ(int x, int y, int z, int c,int d,int e,int mx,int mz)
BlockPos(x,y,z,1)
BlockDel()
if e==mz then return 1
e=e+1
z=z+1
return LoopZ(x,y,z,c,d,e,mx,mz)
endfunc
It levels an area of 21*21 around the CPU from the location of the CPU to the top of the map.
you can change the area of effect by changing a to a number between 0 and 2,147,483,647 i think however i do advise against going over 50 as this takes some 20 seconds for my computer to run and it got a quite good CPU.
Anyway enjoy
I can't find where the list of functions is :sad.gif:
Can you help me?
Quote from Biohazard »
Break() #Stops the script
BlockPos(int X, int Y, int Z, int BlockID) #Set XYZ where the block BlockID shall spawn
BlockSpawn() #Spawn the block
BlockDel() #Replaces the selected block with Air
ChatMessage(String Chatmessage) #Add text to Chat
ChatGlowMessage(String Chatmessage) #Make the text glow (Like the "Now Playing: Cat")
PlayerHealth(int Health) #Change the health of the player
PlayerJump() #Make the Player Jump
PlayerHurt() #Hurt the player 2 Lifes
WorldTime(int Time) #Change the world time
It levels an area of 21*21 around the CPU from the location of the CPU to the top of the map.
you can change the area of effect by changing a to a number between 0 and 2,147,483,647 i think however i do advise against going over 50 as this takes some 20 seconds for my computer to run and it got a quite good CPU.
Anyway enjoy
it's between 0 and ~300 cause the chunks behind that distance are unloaded and i don't think minecraft loads up to 134217727 chunks at the same time into the ram
EDIT: I have a nice title now
true but that dosnt mean the script for that area wont be run, however i doubt it will have an effect on the area.
lol i found out that even code(i don't mean functions) outside of the onTrigger function gets run on redstone apply
and how can i make vars not jump back to their old value when the function ends?
save it on the global variable as shown on the floodgate script
i have a question Biohazard is this how the GUI should look like?
btw why is the cpu block dropping sugar? 97(CPU Block ID)+256(omg wtf is this?)=353(id for sugar)
The GUI should look like that (HOW DID YOU DO THAT?) and yes, it drops sugar, but the dropping issue is fixed (New release soon if i can see how to fix the GUI)
Yay, it works! I didn't think that redstone activates it.
But witch script will start if there are many, maybe all will launch in one time?
So I don't have problem. Thanks :-)
Right click a CPU to select the script for the CPU.
Yay, it works! I didn't think that redstone activates it.
But witch script will start if there are many, maybe all will launch in one time?
So I don't have problem. Thanks :-)
Right click a CPU to select the script for the CPU.
why is it working for everyone now was it updated or something because mcp is officially 1.5
But every time i run it, it just ends in Minecraft "crashing"
i
multiple cpus? for movement i would say pressure plates
Please, anything but Connor.
would you like to share the script? :tongue.gif:
uhhh i dont know i like i said dont know java or stuff like that but if they add the ability to link cpus or choose which side of cpu for the input for certain sides of the scripts. why must everyone know java but me :sad.gif:
edit: share ur script ur code might (if biohazard likes it) be used to make games
why particle all u can do is spawn stuff like bubbles and smo.....ahhh smokescreen, perfect for muliplayer
Ive fixed it:
It levels an area of 21*21 around the CPU from the location of the CPU to the top of the map.
you can change the area of effect by changing a to a number between 0 and 2,147,483,647 i think however i do advise against going over 50 as this takes some 20 seconds for my computer to run and it got a quite good CPU.
Anyway enjoy
Can you help me?
And heres how the language works:
http://fscript.sourceforge.net/fscript/page3.html
true but that dosnt mean the script for that area wont be run, however i doubt it will have an effect on the area.
save it on the global variable as shown on the floodgate script
lucky u at least part of a button appears for u
its a obfuscation problem it'll be fixed as soon as mcp is 1.5 (not the test release)
The GUI should look like that (HOW DID YOU DO THAT?) and yes, it drops sugar, but the dropping issue is fixed (New release soon if i can see how to fix the GUI)
Right click a CPU to select the script for the CPU.
why is it working for everyone now was it updated or something because mcp is officially 1.5