Switches.

Discuss all things Battleships Forever that aren't Ships and Shipmaker - Missions, Development, etc.!

Moderators: th15, Moderators

Post Reply
MagusZero
Lieutenant Commander
Lieutenant Commander
Posts: 98
Joined: Thu Jul 30, 2009 10:30 am

Switches.

Post by MagusZero »

Would be helpful. As in, events that toggle on/off a specific trigger. There are solutions without switches, but they're hacky and stupid and a way of ignoring that the game is missing something which is quite important for impressiveness in terms of movable parts. Rest assured, I like the game even without this, but it's a barrier to creativity. Another thing I might suggest is variables... That might be asking a bit much, since I can't see any particularly strong need for them, but it'd be nice.

Comments?
Silverware
Commodore
Commodore
Posts: 626
Joined: Fri Apr 17, 2009 11:50 am

Post by Silverware »

I've seen and used the language they have to use to write this game, and what they have is already incredibly complex. From memory you can't create variables during gameplay, but it might be possible to add a set of like 3 variables, but even that would be hard to do I believe.
thanto_
Commander
Commander
Posts: 157
Joined: Sat Feb 02, 2008 4:47 pm

Post by thanto_ »

Switches are extremely easy to make with the existing setup. All you need is a single section, preferably a round one. Set it to enabled borders, and set rotation to take 1 frame. Set mode to rotation. Trigger 1 on and Trigger 2 on should be set to whatever you want to trigger the switch. Trigger 1 off should be CW border reached (s), and Trigger 2 off should be CCW Border reached (s). Set the initial rotation to the border that it should be at by default (whichever mode is enabled by default).

Just a single section with s little work, and you have a fully functional ship. If you chain two switches to it, and set it up correctly, you can have a 4-way switch slaved to a single key or triggering event. Slave on 4 more, and you can have an 8-way switch. And so on.

You can also create egg timers by using the same switch system, but removing one of the triggers, and changing one of the frame delays to the amount of time you want it to take to cooldown. This can be used to activate active abilities and provide cooldown delays for directly controlled ships or for visually displaying the amount of time left before a weapon can refire.


If you really wanted to, you could even make a binary calculator.


There are so many things that can be with the current trigger system that adding something like "switches" is a waste of effort.


Variables, on the other hand, might be interesting. There could be a set of registers that could be modified (add, subtract, multiple, divide) and polled. The only problem is what to do when multiple things attempt to modify the same variable register at the same time.
MagusZero
Lieutenant Commander
Lieutenant Commander
Posts: 98
Joined: Thu Jul 30, 2009 10:30 am

Post by MagusZero »

Okay, so how do you disable trigger 1 or trigger 2 so they can only take effect at certain times? If i wanted a part to expand on keypress and close when damaged a certain amount, I wouldn't want it to open when damaged or close on keypress. This is what I'm wanting.
thanto_
Commander
Commander
Posts: 157
Joined: Sat Feb 02, 2008 4:47 pm

Post by thanto_ »

When a single section is damaged a certain amount? No, not possible. Section is destroyed (set of sections is damaged)? Yes, entirely possible.
MagusZero
Lieutenant Commander
Lieutenant Commander
Posts: 98
Joined: Thu Jul 30, 2009 10:30 am

Post by MagusZero »

So it wouldn't be possible to create a takesDamage trigger in later versions, nor would it be possible to create a boolean isActive for each trigger, which could be toggled by triggers? Neither seems brutally complex.
thanto_
Commander
Commander
Posts: 157
Joined: Sat Feb 02, 2008 4:47 pm

Post by thanto_ »

I'm sure it's possible to trigger when damage is dealt to a section, but it's not in the system right now. I'm sure it's also possible to create isActive switches for triggers, but how do you modify them? Wouldn't you need to trigger something to toggle the switch?
MagusZero
Lieutenant Commander
Lieutenant Commander
Posts: 98
Joined: Thu Jul 30, 2009 10:30 am

Post by MagusZero »

Yeah, but for instance you could have a trigger begins with the keyPress and takesDamage triggers, with takesDamage initially off. When executed, you'd want to toggle both switches and expand a part of the ship which has some powerful weaponry or something. Pressing the button won't put it back in, only damage will, at which point it toggles again, so that it won't expand when it takes damage, but will on keypress.

That's my first thought as to a useage, but there would certainly be many more.
Post Reply