• 0

    posted a message on Created Dialog Control, now..?

    So I created a dialog control, it's type is button. They show up fine, they can be clicked on and they act like buttons, etc. etc.

    	//DialogControlCreate(DialogLastCreated(), 3);	
    	libNtve_gf_CreateDialogItemButton(DialogLastCreated(), 165, 45, 3, 25, -135, StringToText("Strength"), (StringToText("STR ") + IntToText(HeroSTR[owner])), null);
    

    I actually created them 2 different ways, shown above. Both of them act in the exact same manner.

    My problem is that when I click on them, I need to be able to distribute a point (attributes) to the stat button that is clicked on.

    However, I use the event below

    TriggerAddEventDialogControl(gt_ProgressionSystemPoints, -1, -1, 0);
    

    (-1 being any player and any dialogcontrol, 0 being eventtype clicked) or any variation, the trigger that I use does not respond in the least. This event responds supposedly to any DialogControl, and it should respond to any DialogControl being clicked.

    UIDisplayMessage(PlayerGroupSingle(owner), 5, StringToText("You pressed some dialog control"));
    

    is the only thing inside the trigger and it should show me a message that I pressed a button. This does not happen, but I also get no syntax errors.

    Another note, the commented script below also works, I just tried a different method of creating the button which works the same way except adds a tooltip.

    	//DialogControlCreate(DialogLastCreated(), 3);	
    	libNtve_gf_CreateDialogItemButton(DialogLastCreated(), 165, 45, 3, 25, -135, StringToText("Strength"), (StringToText("STR ") + IntToText(HeroSTR[owner])), null);// CREATE THE BUTTON
    	//DialogControlSetSize(DialogControlLastCreated(), PlayerGroupSingle(owner), 165, 45);																			// SET BUTTON SIZE
    	//DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupSingle(owner), 3, 25, -135);																	// SET BUTTON X/Y (lEFT/RIGHT UP/DOWN OFFSET, in pixels, automatically anchors to the middle left?)
    	//DialogControlSetPropertyAsText(DialogControlLastCreated(), 1, PlayerGroupSingle(owner), (StringToText("STR ") + IntToText(HeroSTR[owner]))); 				// SET BUTTON TEXT
    	DialogControlSetEnabled (DialogControlLastCreated(), PlayerGroupSingle(owner), true);	
    	DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupSingle(owner), true);
    	DialogControlSetPropertyAsBool(DialogControlLastCreated(), 36, PlayerGroupSingle(owner), true);
    	//libNtve_gf_SetDialogItemClickOnDown (DialogControlLastCreated(), PlayerGroupSingle(owner), true);
    	HeroControl[owner][0] = DialogControlLastCreated();
    

    The Button Code itself

    //=====================================================================================================
    // ProgressionSystem Point Distribution
    //      FUNCTION
    //=====================================================================================================
    bool gt_ProgressionSystemPoints_Func (bool testConds, bool runActions) { 
    //=====================================================================================================
    // LOCAL VARS 
    //=====================================================================================================
    int owner;
    int control;
    //=====================================================================================================
    // ACTIONS
    //=====================================================================================================
    UIDisplayMessage(PlayerGroupSingle(owner), 5, StringToText("You pressed some dialog control"));
    return true;
    }
    //=====================================================================================================
    // ProgressionSystem Point Distribution
    //      EVENTS
    //=====================================================================================================
    
    void gt_ProgressionSystemPoints_Init () {            //ProgressionSystem                              // initializes the trigger for use
        gt_ProgressionSystemPoints = TriggerCreate("gt_ProgressionSystemPoints_Func");                            // actually spawns the trigger, like variables must be called first 
    TriggerAddEventDialogControl(gt_ProgressionSystemPoints, -1, -1, 0);
    }
    
    Posted in: Galaxy Scripting
  • 0

    posted a message on Tutorial - Listing

    Take the picture down or change the link, I kept clicking on that picture cause it looked right and it took me to a broken link XD

    Posted in: Tutorials
  • 0

    posted a message on Miles Laser Tag v3.0

    I would love to see this done, but I unfortunately have only time to produce my current map and I must stay focused, my apologies.

    Keep in mind though that this would be a super popular map, be prepared :)

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Unit Group parameters error
    Quote from Kueken531: Go

    Line 21: Missing semicolon after trigger gt_KamehamehaCast Line 59: Missing ),-1)) after the UnitFilter, UnitGroup expects a MaxCount Parameter. Line 67: Missing comma between blastangle) true Line 73: Missing semicolon after distance = (distance + 1) Line 76: Missing return and }, you never close the function, also all code paths need to return a boolean Line 113: Missing (); after gt_KamehamehaCast_Init

    I managed to locate all of those errors a while ago and fix them, the only issue now is making the data editor do what I want it to. Thank you all for your help and tips, I learned alot. Expect to see a map from me sometime in the future.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Trigger Init Error?

    Edit: Fixed the error, got Notepad and noticed I was missing a bracket and return true; at the end of the function. Thanks for looking everyone

    Posted in: Galaxy Scripting
  • 0

    posted a message on Trigger Init Error?

    So I made this trigger that, as far as I can see, is practically a replica of what the Galaxy editor would give me for GUI. It's giving me errors.

    void gt_KamehamehaCast_Init () {                                                          
        gt_KamehamehaCast = TriggerCreate("gt_KamehamehaCast_Func");                           
    TriggerAddEventUnitAbility(gt_KamehamehaCast, null, AbilityCommand("Kamehameha", 0), c_abilEffectStageFinish, false);
    
    }
    

    This should technically work. I've initialized the trigger here

    //--------------------------------------------------------------------------------------------------
    // Trigger Initialization
    //--------------------------------------------------------------------------------------------------
    void InitTriggers () {
        gt_Init_Init();
        gt_KamehamehaCast_Init();
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Variables
    //--------------------------------------------------------------------------------------------------
    trigger gt_Init;
    trigger gt_KamehamehaCast;
    

    So it gives me an invalid variable name or cannot parse function line. What could possibly be making this go haywire?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Unit Group parameters error

    So I'm still getting errors on the native variables I use in this.

    c_timeGame c_playerAny gives me errors too c_abilEffectStageFinish also

    Am I initializing native libs wrong or what? I've tried alot of different things, it's giving me the same error and I'm almost 100% sure it's because the natives aren't being used properly.

    //==================================================================================================
    // 
    // Generated Map Script
    // 
    // Name:   VGA Rumble
    // 
    //==================================================================================================
    include "TriggerLibs/NativeLib"
    
    //--------------------------------------------------------------------------------------------------
    // Library Initialization
    //--------------------------------------------------------------------------------------------------
    void InitLibs () {
        libNtve_InitLib();
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Variables
    //--------------------------------------------------------------------------------------------------
    trigger gt_Init;
    trigger gt_KamehamehaCast
    
    //--------------------------------------------------------------------------------------------------
    // Custom Script: Kamehameha
    //--------------------------------------------------------------------------------------------------
    
    
    bool gt_KamehamehaCast_Func (bool testConds, bool runActions) { 
    	unit caster;
    	int range;
    	int distance;
    	fixed casterangle;
    	fixed blastangle;
    	point blast;
    	unitgroup moved;
    	point blastoffset;
    // Actions
    
        if (!runActions) 
        {
            return true;
        }
    //^^^^^^^^^^^^^^^^^^-- Defines whether or not the events come back true, then runs the rest of the trigger
    	caster = EventUnit();
    	range = 40;
    	distance = 0;
    	casterangle = UnitGetFacing(caster);			//            POINT  RNG     FILTER
    	blast = UnitGetPosition(caster);                      //              V     V		v
    	
      	
    
    while ((distance < range))
    	{				// while loop, will set the offset of the blast, get units near the blast put them in a unit group
    					// creates an effect at the blast offset, pick each unit in the unit group and push them away at the angle of the blast
    					// will repeat every 0.15 sec
    	blastoffset = PointWithOffsetPolar(blast, 1.0, casterangle);
    	blast = PointWithOffsetPolar(blast, 1.0, casterangle);
    	PlayerCreateEffectPoint(1, "KamehamehaDummyBlast", blast); 
    	   UnitGroupLoopBegin(UnitGroup(null, c_playerAny, RegionCircle(blast, 1.3), UnitFilter(0, 0, (1 << c_targetFilterAlly), (1 << (c_targetFilterDead - 32));
                    // loop begins;
             while (!UnitGroupLoopDone())                                                                 
                 // picks all units in moved, then moves them, hopefully ends the loop;
    	   {
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), true);
    	   Wait(0.05, c_timeGame);
    	   blastangle = AngleBetweenPoints(blast, UnitGetPosition(UnitGroupLoopCurrent()));
     	   UnitSetPosition(UnitGroupLoopCurrent(), PointWithOffsetPolar(UnitGetPosition(UnitGroupLoopCurrent()), 0.2, blastangle) true);
    	   Wait(0.05, c_timeGame);
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), false);
             UnitGroupLoopStep();
        	   }
        UnitGroupLoopEnd();
    	distance = (distance + 1)
    	Wait(0.15, c_timeGame);
    	}
    
    // -------------------------------------=-=-=-=DEFINING EVENTS=-=-=-=------------------------------------------
    void gt_KamehamehaCast_Init () {                                                            // initializes the trigger for use
        gt_KamehamehaCast = TriggerCreate("gt_KamehamehaCast_Func");                            // actually spawns the trigger, like variables must be called first 
    TriggerAddEventUnitAbility(gt_KamehamehaCast, null, AbilityCommand("Kamehameha", 0), c_abilEffectStageFinish, true);
    
    }
    
    //--------------------------------------------------------------------------------------------------
    // Custom Script Initialization
    //--------------------------------------------------------------------------------------------------
    void InitCustomScript () {
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger: Init
    //--------------------------------------------------------------------------------------------------
    bool gt_Init_Func (bool testConds, bool runActions) {
        // Actions
        if (!runActions) {
            return true;
        }
    
        libNtve_gf_CreateUnitsWithDefaultFacing(1, "Goku", 0, 1, UnitGetPosition(UnitFromId(14)));
        return true;
    }
    
    //--------------------------------------------------------------------------------------------------
    void gt_Init_Init () {
        gt_Init = TriggerCreate("gt_Init_Func");
        TriggerAddEventMapInit(gt_Init);
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Initialization
    //--------------------------------------------------------------------------------------------------
    void InitTriggers () {
        gt_Init_Init();
        gt_KamehamehaCast_Init
    }
    
    //--------------------------------------------------------------------------------------------------
    // Map Initialization
    //--------------------------------------------------------------------------------------------------
    void InitMap () {
        InitLibs();
        InitCustomScript();
        InitTriggers();
    }
    

    There is the entirity of the script in the map.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Unit Group parameters error

    I think I figured out what's wrong, but no idea how to fix it. I commented out the entire unitgroup loop and found that the Wait code was giving me an error for wrong variable. c_timeGame and c_playerAny are what are giving me errors. Why are natives giving me errors? lol

    Posted in: Galaxy Scripting
  • 0

    posted a message on Unit Group parameters error

    Awesome, thank you very much for your replies! I've learned alot just from the few posts you've made!

    Ok so I removed the bracket, I moved the bracket to make the angle actually calculate, fixed the polar offsets, removed the else. For some reason the unit filter is still giving me errors.

    while ((distance < range))
    	{				// while loop, will set the offset of the blast, get units near the blast put them in a unit group
    					// creates an effect at the blast offset, pick each unit in the unit group and push them away at the angle of the blast
    					// will repeat every 0.15 sec
    	blastoffset = PointWithOffsetPolar(blast, 1.0, casterangle);
    	blast = PointWithOffsetPolar(blast, 1.0, casterangle);
    	PlayerCreateEffectPoint(1, "KamehamehaDummyBlast", blast); 
    	   UnitGroupLoopBegin(UnitGroup(null, c_playerAny, RegionCircle(blast, 1.3), UnitFilter(0, 0, (1 << c_targetFilterAlly), (1 << (c_targetFilterDead - 32));
                    // loop begins;
             while (!UnitGroupLoopDone())                                                                 
                 // picks all units in moved, then moves them, hopefully ends the loop;
    	   {
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), true);
    	   Wait(0.05, c_timeGame);
    	   blastangle = AngleBetweenPoints(blast, UnitGetPosition(UnitGroupLoopCurrent()));
     	   UnitSetPosition(UnitGroupLoopCurrent(), PointWithOffsetPolar(UnitGetPosition(UnitGroupLoopCurrent()), 0.2, blastangle) true);
    	   Wait(0.05, c_timeGame);
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), false);
             UnitGroupLoopStep();
        	   }
        UnitGroupLoopEnd();
    	distance = (distance + 1)
    	Wait(0.15, c_timeGame);
    	}
    	
    
    Posted in: Galaxy Scripting
  • 0

    posted a message on Unit Group parameters error

    @Exaken: Go

    The variables I used were called at the top of the trigger like so

    point blast; fixed angle; etc.

    I'll check the bracket and the parenthesis

    Ok so when I did that, it then gave me invalid parameter and too many parameters errors.

    The only thing I can think of is there is something wrong with my trigger initializations and such, because I don't quite understand that process yet. Here is the whole script.

    //==================================================================================================
    // 
    // Script 
    // 
    // Name:   Ability
    // Use: Create a trigger driven ability or two to sharpen your scripting skills, recall WC3 skills and methods
    //==================================================================================================
    include "TriggerLibs/NativeLib"
    
    //--------------------------------------------------------------------------------------------------
    // Library Initialization
    //--------------------------------------------------------------------------------------------------
    void InitLibs () {
        libNtve_InitLib();
    }
    
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Variables
    //--------------------------------------------------------------------------------------------------
    trigger gt_Init;
    trigger gt_KamehamehaCast;
    
    
    //--------------------------------------------------------------------------------------------------
    // Trigger: Init
    //--------------------------------------------------------------------------------------------------
    bool gt_Init_Func (bool testConds, bool runActions) {
        // Actions
        if (!runActions) {
            return true;
        }
        
        libNtve_gf_CreateUnitsWithDefaultFacing(1, "Goku", 0, 1, UnitGetPosition(UnitFromId(14)));
        return true;
    }
    
    //--------------------------------------------------------------------------------------------------
    void gt_Init_Init () {
        gt_Init = TriggerCreate("gt_Init_Func");
        TriggerAddEventMapInit(gt_Init);
    }
    //--------------------------------------------------------------------------------------------------
    // Trigger: Kamehameha Cast 
    // Written by Unclesatan
    //--------------------------------------------------------------------------------------------------
    bool gt_KamehamehaCast_Func (bool testConds, bool runActions) { 
        unit caster;
    	int range;
    	int distance;
    	fixed casterangle;
    	fixed blastangle;
    	point blast;
    	//unitgroup moved;
    	point blastoffset;
    // Actions
    
        if (!runActions) 
        {
            return true;
    
        }
    	
    //^^^^^^^^^^^^^^^^^^-- Defines whether or not the events come back true, then runs the rest of the trigger
    	caster = EventUnit();
    	range = 40;
    	distance = 0;
    	casterangle = UnitGetFacing(caster);			//            POINT  RNG     FILTER
    	blast = UnitGetPosition(caster);                      //              V     V		v
    	
      	
    
    	while ((distance < range))
      {				// while loop, will set the offset of the blast, get units near the blast put them in a unit group
    					// creates an effect at the blast offset, pick each unit in the unit group and push them away at the angle of the blast
    					// will repeat every 0.15 sec
    	blastoffset = PointWithOffsetPolar(blast, 1.0, casterangle);
          blast = blastoffset;
    	PlayerCreateEffectPoint(1, "KamehamehaDummyBlast", blast); 
    	   UnitGroupLoopBegin(UnitGroup(null, c_playerAny, RegionCircle(blast, 1.3), UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly), 0)));
                    // loop begins;
             while (!UnitGroupLoopDone())                                                                 
                 // picks all units in moved, then moves them, hopefully ends the loop;
    	   {
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), true);
    	   Wait(0.05, c_timeGame);
    	   blastangle = AngleBetweenPoints(blast), UnitGetPosition(UnitGroupLoopCurrent()));
     	   UnitSetPosition(UnitGroupLoopCurrent(), PointWithOffsetPolar(UnitGetPosition(UnitGroupLoopCurrent())), 0.2, blastangle, true);
    	   Wait(0.05, c_timeGame);
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), false);
             UnitGroupLoopStep();
             }
        UnitGroupLoopEnd();
       	distance = (distance + 1)
    	Wait(0.15, c_timeGame);
      }
      
    	else(){
      }
    	
    // -------------------------------------=-=-=-=DEFINING EVENTS=-=-=-=------------------------------------------
    void gt_KamehamehaCast_Init () {                                                            // initializes the trigger for use
        gt_KamehamehaCast = TriggerCreate("gt_KamehamehaCast_Func");                            // actually spawns the trigger, like variables must be called first 
    TriggerAddEventUnitAbility(gt_KamehamehaCast, null, AbilityCommand("Kamehameha", 0), c_abilEffectStageFinish, true);
    
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Initialization APPARENTLY must be at the bottom of the script or something
    //------------------------------------------------- -------------------------------------------------
    void InitTriggers () 
    {
    					//ALL your triggers must be initialized here.  Unknown if you can initialize triggers after a certain period of time for efficiency.
    	gt_KamehamehaCast_Init(); 
    
    }
    

    Sorry if it's huge or a mess.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Unit Group parameters error
    Quote from Exaken: Go

    @unclesatan: Go You cannot declare a variable in a parameter, like you do with:

    RegionCircle(point blast, 1.3)
    

    That was simply the result of me mussing with the code trying to get it to work. Whether or not it is point blast, or simply blast (the variable I already declared at the top of the script with the rest of them), it still gives me invalid parameter list. Sorry for the confusion there. I updated my code

    I do now realize that I was attempting to declare a variable there, but like I said it did not change the error message for some reason.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Unit Group parameters error

    I'm new to this community, used to script in WC3 but never truly finished anything. I'd like to take my ideas and put them into Starcraft, or at least just get back into scripting. So far, the only thing hindering me is the massively confusing data editor haha..

    My problem is when I try and use UnitGroupLoopBegin

    This gives me incorrect parameter error. I converted some GUI for the UnitGroupLoopBegin and all the parameters, the only thing I changed was the point (blast) which was called and used multiple times before in the trigger. Also tried modifying the script in various manners and just can't get it to work right.

    What I'm attempting is to pick all units in the region and use a trigger to move them at an angle away from the blast until they're out of the radius, in case that helps. The script is down below.

    All variables are called already

    	   UnitGroupLoopBegin(UnitGroup(null, c_playerAny, RegionCircle(blast, 1.3), UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly), 0));
        {
                    // loop begins;
             while (!UnitGroupLoopDone())                                                                 
                 // picks all units in moved, then moves them, hopefully ends the loop;
    	   {
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), true);
    	   Wait(0.05, c_timeGame);
    	   blastangle = AngleBetweenPoints(blast), UnitGetPosition(UnitGroupLoopCurrent()));
     	   UnitSetPosition(UnitGroupLoopCurrent(), PointWithOffsetPolar(UnitGetPosition(UnitGroupLoopCurrent())), 0.2, blastangle, true);
    	   Wait(0.05, c_timeGame);
    	   libNtve_gf_PauseUnit(UnitGroupLoopCurrent(), false);
             UnitGroupLoopStep();
             }
    
    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.