I am relatively new to CC and coding, so perhaps this was not my wisest of choices for a project. At any rate, I am building an arena using spawners from Soul Shards (disabled with a constant redstone signal), a force field from MFFS (to lock both players and mobs in the arena), seer stones from ars magica (emits a redstone signal when mobs are present), extra peripherals( to connect to project red bundled wire).
here is the skinny, I have things set up so that people can enter the arena, press a button and the force field engages, then I am trying to set it up so that the computer will enable one spawner at a time. As each mob is killed it will move to the next one(9 spawners so far, possibly expanding later). Then once all spawners have been gone through, the field will go do down and allow the player to leave, then the system will reset for the next time.
here is the code I have so far, am I even close?
http://pastebin.com/Wpyr2xrp
(for some reason I can't use the code tags in the editor So I pastebin'd it.)
any assistance would be greatly appreciated.
Building an arena.
Started by drkmachine, Feb 28 2014 12:25 AM
4 replies to this topic
#1
Posted 28 February 2014 - 12:25 AM
#2
Posted 28 February 2014 - 02:31 AM
Sort of... not really? It looks promising on the surface, and you've certainly got some idea as to how to go about it, but even with the larger bugs ironed out of it I can't see it doing exactly what you want without a fair bit of a re-write.
If I've got this right, the goal is to have the computer wait for a redstone signal from its bottom, then enable the force field (by emitting a redstone signal from its top) and start cycling through the mob spawners (by sending signals to the left) based on seer stone input (from the back). If a second button (leading to the computer's right) is pressed during combat then the force field goes down and the mob spawner is stopped.
One issue here is that giving a signal to the mob spawner, to my understanding, will not simply cause it to "spawn a mob". Instead, it "activates" the spawner, which will create groups of mobs at somewhat random intervals in somewhat random amounts. So it'll take a while for the seer stone to activate after the mob spawner does, and once it DOES activate, it won't DEactivate until the player is able to clear the room... during which time the spawner is going to keep pumping mobs in there... Depending on the terrain and abilities of the player, this could lead to either very long or very short battles.
Seems to me you want to rig up a timer system - run the spawner for something like a minute, then wait for all the mobs to go away, then move to the next spawner.
Anyway, I've attempted such a re-write myself, but I've not tested it.
If I've got this right, the goal is to have the computer wait for a redstone signal from its bottom, then enable the force field (by emitting a redstone signal from its top) and start cycling through the mob spawners (by sending signals to the left) based on seer stone input (from the back). If a second button (leading to the computer's right) is pressed during combat then the force field goes down and the mob spawner is stopped.
One issue here is that giving a signal to the mob spawner, to my understanding, will not simply cause it to "spawn a mob". Instead, it "activates" the spawner, which will create groups of mobs at somewhat random intervals in somewhat random amounts. So it'll take a while for the seer stone to activate after the mob spawner does, and once it DOES activate, it won't DEactivate until the player is able to clear the room... during which time the spawner is going to keep pumping mobs in there... Depending on the terrain and abilities of the player, this could lead to either very long or very short battles.
Seems to me you want to rig up a timer system - run the spawner for something like a minute, then wait for all the mobs to go away, then move to the next spawner.
Anyway, I've attempted such a re-write myself, but I've not tested it.
Spoiler
#3
Posted 28 February 2014 - 03:29 AM
First, thank you for the time you have taken to help.
Yes, you have the jist of it. Altho the back and bottom are reversed, simple change in the code.
The only issue I have with using a timer is that soul shards doesn't always spawn a mob within a minute, I was hoping to use the seer stones as a switch for both detecting when mobs initially spawn (turning the active spawner off) and detecting when to move to the next one. I will give this code a run in game shortly, perhaps the timer will be a moot point with a little adjustment to the time.
Yes, you have the jist of it. Altho the back and bottom are reversed, simple change in the code.
The only issue I have with using a timer is that soul shards doesn't always spawn a mob within a minute, I was hoping to use the seer stones as a switch for both detecting when mobs initially spawn (turning the active spawner off) and detecting when to move to the next one. I will give this code a run in game shortly, perhaps the timer will be a moot point with a little adjustment to the time.
#4
Posted 28 February 2014 - 04:18 AM
You could, instead of waiting for a timer, wait for the seer stone's input to turn on - you'd use pretty much the same code that waits for it to turn off.
I've also somewhat of a memory that maybe the spawners are only disabled when a redstone signal is applied (as opposed to removed). If that's the case, then you'd instead use this to turn them all off:
65535 being the result of "colors.combine()"ing all possible colours.
And this would enable any given one:
I've also somewhat of a memory that maybe the spawners are only disabled when a redstone signal is applied (as opposed to removed). If that's the case, then you'd instead use this to turn them all off:
p.setBundledOutput(65535)
65535 being the result of "colors.combine()"ing all possible colours.
And this would enable any given one:
p.setBundledOutput(colors.subtract(65535, entColors[i]))
#5
Posted 28 February 2014 - 04:38 AM
lol, was just working through that colors.combine as I noticed this was updated.
that is superb! Will adjust the code and test again, I thank you for your time and effort!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











