• 0

    posted a message on Unit[3] dies = Destroy Textmark[3]

    @MaskedImposter: Go

    Quote from Mille25: Go

    The string identifier can be constructed using the units tag and converting it into a string.

    ... :D

    Posted in: Triggers
  • 0

    posted a message on Unit[3] dies = Destroy Textmark[3]

    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.

    Posted in: Triggers
  • 0

    posted a message on Action Definition Option: Loop

    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:

    #AUTOVAR(s, string) = #PARAM(str);
    #AUTOVAR(len) = StringLength(#AUTOVAR(s));
    for(#AUTOVAR(index) = 1; #AUTOVAR(index) <= #AUTOVAR(len); #AUTOVAR(index) += 1) {
        #PARAM(iterator) = StringSub(#AUTOVAR(s), #AUTOVAR(index), #AUTOVAR(index));
        #SUBFUNCS(Actions)
    }
    

    5. Test your custom loop and profit!

    test custom loop
        Events
            Game - Map initialization
        Local Variables
            string = "1234" <String>
            c = "" <String>
        Conditions
        Actions
            General - For Each Character In String(c, string)
                Actions
                    Debug - Display (Text(c)) as debug output using Type 01, and Do display it in the game window
    

    Output:

    Quote:

    00:00:00.00 1
    00:00:00.00 2
    00:00:00.00 3
    00:00:00.00 4

    The custom loop will compile to Galaxy code looking similar to this:

        string auto029E29ED_s;
        int auto029E29ED_len;
        int auto029E29ED_index;
    
        [......]
    
        auto029E29ED_s = lv_string;
        auto029E29ED_len = StringLength(auto029E29ED_s);
        for(auto029E29ED_index = 1; auto029E29ED_index <= auto029E29ED_len; auto029E29ED_index += 1) {
            lv_c = StringSub(auto029E29ED_s, auto029E29ED_index, auto029E29ED_index);
            TriggerDebugOutput(1, StringToText(lv_c), true);
        }
    
    Posted in: Triggers
  • 0

    posted a message on Cleaning up

    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.

    Posted in: Triggers
  • 0

    posted a message on Action Definition Option: Loop

    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.

    Posted in: Triggers
  • 0

    posted a message on Action Definition Option: Loop

    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.

    Posted in: Triggers
  • 0

    posted a message on Camera tracking?

    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.

    Posted in: Triggers
  • 0

    posted a message on Project "HANSA" [Online competitive FPS]

    Pretty cool! Reminds me a bit of Counter-Strike 1.6! :D

    Posted in: Project Workplace
  • 0

    posted a message on Timer per unit vs shared timer
    Quote:

    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.

    Posted in: Triggers
  • 0

    posted a message on Winners?

    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.

    Posted in: General Chat
  • 0

    posted a message on Timer per unit vs shared timer

    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.

    Posted in: Triggers
  • 0

    posted a message on Make camera follow point above unit

    You can use pan camera in a loop. The pan position would be point with polar offset.

    Posted in: Triggers
  • 0

    posted a message on How Laggy Will This Be?

    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.

    Posted in: Triggers
  • 0

    posted a message on Splat Model Clipping and Layers?

    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.

    Posted in: Data
  • 0

    posted a message on Splat Model Clipping and Layers?

    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?

    Posted in: Data
  • To post a comment, please or register a new account.