![]() ![]() ITerminalAction stopTimer = timer.GetActionWithName("Stop") ////////// Initialize the timer block and set up actions I've almost got it, but i'm just not quite there. Thanks again for all of your help! However, once again, I'm sort of at a loss, here. How do I make these thrusters fire only while the timer is counting? Am I wrong to assume that the bool is a usable variable in this context? I'm trying to use it in that while-loop that I have in my code, and it's giving me an error. ![]() I assume that the bool IsCountingDown under the fields there is something that I can use like a boolean variable. They are quite similar, but there are some subtle differences. I'm more used to java than I am used to C#. GetActionWithName("DecreaseOverride").Apply(mainThrusters ) //////// Decrease the thrust after the timer is done counting.įor (int i = 0 i < mainThrusters.Count i++) GetActionWithName("IncreaseOverride").Apply(mainThrusters ) ![]() ///////// Increase the thrust of the thrusters while the timer is counting down.įor(int i = 0 i < mainThrusters.Count i++) ITerminalAction startTimer = timer.GetActionWithName("Start") Var timer = GridTerminalSystem.GetBlockWithName("Timer Block") List mainThrusters = group.BlocksVar list = GridTerminalSystem.BlockGroups ////////// Put the main thrusters into a list by grouping. Here is my code (the part that i'm having trouble with is bolded and underlined): In this case, the thrusters will use the DecreaseOverride method after the timer has finished counting. Now, I'm trying to sort of link the action of overriding the accelleration with a timer block. I think once I get this figured out, I can maybe sort of figure out the rest. Is there perhaps a way to make a sepearte list for just those two thrusters? Or perhaps a way to assign those two thrusters to a specific index within the list? ITerminalAction increaseThrust = mainThrusters.GetActionWithName("IncreaseOverride") GridTerminalSystem.GetBlocksOfType(mainThrusters) įor(int i = 0 i < increaseCount i++) List mainThrusters = new List()I got the thrust to override for a single thruster at the index of the list of thrusters, which is cool, but not exactly what I was looking for. Would anyone mind helping me out with this? My programming experience is extremely limited. These two thrusters are the forward thrusters of my ship. Nice and tidy.I'm trying to increase the override for 2 of the 8 of my thrusters on my ship. Then it's all automated and you don't have to restart anything even if you exit and reload the game, and you can easily add more scripts even while everything else is running by simply editing the programmable block list in the master block. Or there could be some conditions that the master script uses to determine which script to run.Īnd, of course, if you combine all of the above you can have a setup where a timer block automatically runs the master script (to get everything started) that starts all the slave scripts. Then you can just edit that list to add/remove scripts. This allows you to make it even more dynamic as the master script could, for example, read the names of the programmable blocks from its custom data and then start the scripts stored in them. You can have a master script that executes the other scripts. You can set the Runtime.UpdateFrequency flags to make your script run repeatedly after the initial call to it. ![]() You don't necessarily need a timer block at all. I think there are 90 slots available, although you need a few of them to control the timer block itself so that it loops. A timer block has multiple slots in its action list. There are several options that you can do: ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |