The best practise to link any sort of data to units is to use a data table entry. The string identifier can be constructed using the units tag and converting it into a string. Datatables will allow you to link near infinite amounts of data to a unit, without the limit of 64 custom values and, even more important, potentionally without using any static array sizes.
Lets say you wanted to create a custom loop that allows to iterate over all characters of a given string.
1. Create a new action and check the loop and sub functions flags.
2. Add the required parameters, in this case we need the iterator (Type: Any Variable - String) and the string itself (Type: String). The iterator is a string in this case as Galaxy does not support the char data type.
3. Add a new sub function type and leave everything at default.
4. Go into the custom script part of the action definition and enter the following code. Note that all references must match the SCRIPT IDENTIFIER of the paramters and sub actions:
Have a player group with all voting players at the beginning. Once a player votes, remove him from the group. Once the group is empty that equals to all players having voted, so you can simply check if the player group is empty to shorten the time.
No. The loop flag allows creating custom loops by using the GUI to Galaxy compiler (Comparable to Cs preprocessor for macros), but it has nothing to do with actual program logic.
Loop actions allow you to create your own type of loops. Not necessary to worry about that in the beginning as it is an advanced option and almost never needed.
Its difficult to do. There is no way to properly "calculate" anything, so you would pretty much have to figure out all the values by hand by testing carefully. The models animation is a pure visual thing connected to its actor.
But yes, in theory it is possible to do. Triggers could periodically check a triangular area within a certain angle of the camera, the angle would change based on game time. Its one of the most pain in the ass things you could ask for though, even for an experienced coder.
So basically I should try to stay away from triggers whenever possible if I want the most performant result?
Not necessarily. The best advice would be to do it whatever makes it the most easy for you and makes the most sense.
For example, linking script timers to units is way more difficult than just using a behavior, even though it is actually possible by using data tables and unit tags and other approaches.
One disadvantage of mixing code and data is that it often gets difficult to understand how a system as a whole works together, especially when not looking at that part of code for a couple weeks. Another thing i really dislike about data in general is the fact that it is pretty hard to stay organized and clean.
Could also use a behavior that lasts 60 seconds for every unit. Once it expires, catch the event via triggers and add minerals, then re-add the behavior to the triggering unit.
I think you greatly underestimate the power of modern computers. A functionality like this shouldnt cause any lag at all. Again - Just program your game and at the end, when its done, profile it. If required do optimizations at the correct spots. 99,9% of the time you dont need to care about lag.
If you really want your game to run smooth, make sure to keep an eye on actor, unit and behavior count.
I managed to reduce the clipping issue by minimizing the splat model Z scale. For some reason that makes the effect less visible.
Layers solved by using multiple different models. Would still be interresting to know if there is a way to prioritize certain splats over others via data.
I am currently working on a dynamic terrain generation system, and in order to get the textures working im using a custom splat model which can be used as a doodad to print the terrain textures by placing it.
However, Im currently facing two different issues.
1) Is there any way to create different "layers" for splats, so for example that Texture1 is always rendered ABOVE texture2, and so forth? The only field I found in data is called "Art - Priority" within the model itself, but it doesnt seem to have any effect for me. I need a way to layer various splats over each other to mix terrain textures.
2) Im experiencing some weird clipping issues of splats connected to camera farclip (See attached screenshot). Anyone has an idea what this is caused by and if it can be fixed?
0
@MaskedImposter: Go
... :D
0
The best practise to link any sort of data to units is to use a data table entry. The string identifier can be constructed using the units tag and converting it into a string. Datatables will allow you to link near infinite amounts of data to a unit, without the limit of 64 custom values and, even more important, potentionally without using any static array sizes.
0
Lets say you wanted to create a custom loop that allows to iterate over all characters of a given string.
1. Create a new action and check the loop and sub functions flags.
2. Add the required parameters, in this case we need the iterator (Type: Any Variable - String) and the string itself (Type: String). The iterator is a string in this case as Galaxy does not support the char data type.
3. Add a new sub function type and leave everything at default.
4. Go into the custom script part of the action definition and enter the following code. Note that all references must match the SCRIPT IDENTIFIER of the paramters and sub actions:
5. Test your custom loop and profit!
Output:
The custom loop will compile to Galaxy code looking similar to this:
0
Have a player group with all voting players at the beginning. Once a player votes, remove him from the group. Once the group is empty that equals to all players having voted, so you can simply check if the player group is empty to shorten the time.
0
No. The loop flag allows creating custom loops by using the GUI to Galaxy compiler (Comparable to Cs preprocessor for macros), but it has nothing to do with actual program logic.
0
Loop actions allow you to create your own type of loops. Not necessary to worry about that in the beginning as it is an advanced option and almost never needed.
0
Its difficult to do. There is no way to properly "calculate" anything, so you would pretty much have to figure out all the values by hand by testing carefully. The models animation is a pure visual thing connected to its actor.
But yes, in theory it is possible to do. Triggers could periodically check a triangular area within a certain angle of the camera, the angle would change based on game time. Its one of the most pain in the ass things you could ask for though, even for an experienced coder.
0
Pretty cool! Reminds me a bit of Counter-Strike 1.6! :D
0
Not necessarily. The best advice would be to do it whatever makes it the most easy for you and makes the most sense.
For example, linking script timers to units is way more difficult than just using a behavior, even though it is actually possible by using data tables and unit tags and other approaches.
One disadvantage of mixing code and data is that it often gets difficult to understand how a system as a whole works together, especially when not looking at that part of code for a couple weeks. Another thing i really dislike about data in general is the fact that it is pretty hard to stay organized and clean.
0
Love the idea of themed contests! This could really help filling some gaps!
Im wondering how much impact it would have on the number of participants though.
0
Could also use a behavior that lasts 60 seconds for every unit. Once it expires, catch the event via triggers and add minerals, then re-add the behavior to the triggering unit.
0
You can use pan camera in a loop. The pan position would be point with polar offset.
0
I think you greatly underestimate the power of modern computers. A functionality like this shouldnt cause any lag at all. Again - Just program your game and at the end, when its done, profile it. If required do optimizations at the correct spots. 99,9% of the time you dont need to care about lag.
If you really want your game to run smooth, make sure to keep an eye on actor, unit and behavior count.
0
Update:
I managed to reduce the clipping issue by minimizing the splat model Z scale. For some reason that makes the effect less visible. Layers solved by using multiple different models. Would still be interresting to know if there is a way to prioritize certain splats over others via data.
@FunkyUserName: Go
About lag, it really comes down to the number of splats you are using. As long as you keep the numbers low the FPS loss should be minimal.
0
Hi,
I am currently working on a dynamic terrain generation system, and in order to get the textures working im using a custom splat model which can be used as a doodad to print the terrain textures by placing it.
However, Im currently facing two different issues.
1) Is there any way to create different "layers" for splats, so for example that Texture1 is always rendered ABOVE texture2, and so forth? The only field I found in data is called "Art - Priority" within the model itself, but it doesnt seem to have any effect for me. I need a way to layer various splats over each other to mix terrain textures.
2) Im experiencing some weird clipping issues of splats connected to camera farclip (See attached screenshot). Anyone has an idea what this is caused by and if it can be fixed?