• 0

    posted a message on Replace MapScript.galaxy with own

    Simply a copy paste error sorry about that. Also, the environment is completely different from c/cplusplus and my syntax highlighting package doesn't work properly. It would really help if it functioned correctly and errors were more helpful.

    Anyways I see the issue, although I don't remember changing it. Me trying to modify const vars was due to me originally having vars in function( not const ). Trying to modify code I wrote in the trigger editor 10 months ago doesn't work out too well xD.

    Anyways, thanks for the help, error parsing for just didnt make me think about variables, a undeclared variable nCivsGiven would be much more helpful.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own
    const int maxCivGamble = 20;
    
    const fixed badSub = 4.0;
    const fixed regAdd = 3.0;
    const fixed goodAdd = 1.0;
    const fixed tier1Sub = 4.0;
    const fixed tier2Sub = 1.0;
    const fixed tier3Add = 2.5;
    
    string[nTier1] teir1;
    string[nTier2] teir2;
    string[nTier3] teir3;
    string[nTier4] teir4;
    string[nTier5] teir5;
    string[nTier6] teir6;
    string[nTierEnemy] teirEnemy;
    const fixed tier4Add = 1.5;
    const fixed tier5Add = 1.0;
    
    const fixed badChance = 69.0;
    const fixed regChance = 30.0;
    const fixed goodChance = 1.0;
    const fixed tierchance1 = 65.0;
    const fixed tierchance2 = 22.0;
    const fixed tierchance3 = 10.0;
    const fixed tierchance4 = 2.0;
    const fixed tierchance5 = 1.0;
    
    const int nTier1 = 12;
    const int nTier2 = 12;
    const int nTier3 = 9;
    const int nTier4 = 6;
    const int nTier5 = 1;
    const int nTier6 = 1;
    const int nTierEnemy = 2;
    

    Here you go :D

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    For some reason the tabs got really messed up in the paste...

    void CIvGambleforPlayer (int p, region base) 
    {
        unitgroup civillianGamble = UnitGroupEmpty();
    	int index = 1;
        int nCivGiven;
        fixed randomReal;
        int randomInt;
    
        UnitGroupLoopBegin(UnitGroup("CivilianFemale", p, RegionFromId(69), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
        for ( ; !UnitGroupLoopDone(); UnitGroupLoopStep() ) 
    	{
            civillianGamble = UnitGroup(UnitGetType(UnitGroupLoopCurrent()), p, RegionFromId(69), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
        }
        UnitGroupLoopEnd();
        nCivGiven = UnitGroupCount(civillianGamble, c_unitCountAlive);
        if (nCivGiven > maxCivGamble) 
    	{
            nCivGiven = maxCivGamble;
        }
        if (nCivGiven >= 1) 
    	{
            for ( ; index <= nCivsGiven; index += 1 )
    		{
                UnitRemove(UnitGroupUnit(civillianGamble, index));
            }
            badChance = (badChance - (badSub * (nCivGiven - 1.0)));
            regChance = (regChance + (regAdd * (nCivGiven - 1.0)));
            goodChance = (goodChance + (goodAdd * (nCivGiven - 1.0)));
            tierchance1 = (tierchance1 - (tier1Sub * (nCivGiven - 1.0)));
            tierchance2 = (tierchance2 - (tier2Sub * (nCivGiven - 1.0)));
            tierchance3 = (tierchance3 + (tier3Add * (nCivGiven - 1.0)));
            tierchance4 = (tierchance4 + (tier4Add * (nCivGiven - 1.0)));
            tierchance5 = (tierchance5 + (tier5Add * (nCivGiven - 1.0)));
            randomReal = RandomFixed(0.0, 100.0);
            if (randomReal < badChance) 
    		{
                randomInt = RandomInt(0, nTierEnemy);
                UnitCreate(1, teirEnemy[randomInt], 0, 6, RegionGetCenter(base), 270.0);
            }
            else if (randomReal < (badChance + regChance) && randomReal > badChance)
    		{
                randomReal = RandomFixed(0.0, 100.0);
                if (randomReal < tierchance1)
    			{
                    randomInt = RandomInt(0, nTier1);
                    UnitCreate(1, teir1[randomInt], 0, p, RegionGetCenter(base), 270.0);
                }
                else if (randomReal > tierchance1 && randomReal < (tierchance1 + tierchance2))
    			{
                    randomInt = RandomInt(0, nTier2);
                    UnitCreate(1, teir2[randomInt], 0, p, RegionGetCenter(base), 270.0);
                }
                else if (randomReal > (tierchance1 + tierchance2) && (randomReal < tierchance1 + tierchance2 + tierchance3))
    			{
                    randomInt = RandomInt(0, nTier3);
                    UnitCreate(1, teir3[randomInt], 0, p, RegionGetCenter(base), 270.0);
                }
                else if (randomReal > (tierchance1 + tierchance2 + tierchance3) && randomReal < (tierchance1 + tierchance2 + tierchance3 + tierchance4))
    			{
                    randomInt = RandomInt(0, nTier4);
                    UnitCreate(1, teir4[randomInt], 0, p, RegionGetCenter(base), 270.0);
                }
                else if (randomReal > tierchance1 + (tierchance2 + tierchance3 + tierchance4) && randomReal < (tierchance1 + tierchance2 + tierchance3 + tierchance4 + tierchance5))
    			{
                    randomInt = RandomInt(0, nTier5);
                    UnitCreate(1, teir5[randomInt], 0, p, RegionGetCenter(base), 270.0);
                }
            }
            else if (randomReal <= (badChance + regChance + goodChance) && randomReal > (badChance + regChance))
    		{
                randomInt = RandomInt(0, nTier6);
                UnitCreate(1, teir6[randomInt], 0, p, RegionGetCenter(base), 270.0);
            }
        }
    }
    
    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    @ImperialGood

    Haha yea, I realized that, I just haven't programmed in base C for quite some time. My last 4 major projects were written in c++ xD.

    This lack of intellisense is really impacting my productivity xD

    Although, I am at a loss of why this code won't compile...

    I didn't paste the whole function due to the fact that it is long and won't assist in finding the error.

    void CIvGambleforPlayer (int p, region base)
    {
        unitgroup civillianGamble = UnitGroupEmpty();
        int index = 1;
        int nCivGiven;
        fixed randomReal;
        int randomInt;

        UnitGroupLoopBegin(UnitGroup("CivilianFemale", p, RegionFromId(69), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
        for ( ; !UnitGroupLoopDone() ; UnitGroupLoopStep() )
        {
            civillianGamble = UnitGroup(UnitGetType(UnitGroupLoopCurrent()), p, RegionFromId(69), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 <<    (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
            }
        UnitGroupLoopEnd();
        nCivGiven = UnitGroupCount(civillianGamble, c_unitCountAlive);
        if (nCivGiven > maxCivGamble)
        {
            nCivGiven = maxCivGamble;
            }
        if (nCivGiven >= 1)
        {
            for (  ; index <= nCivsGiven; index += 1 ) <- Error parsing for, possibly missing ;
            {
                UnitRemove(UnitGroupUnit(civillianGamble, index));
            }

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    @FunkyUserName: Go

    I guess function overloading isnt supported. Thanks for the help.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    Okay I found the part that crashes the editor. It is my trigger declarations... lol. I have no idea what may be wrong.

    trigger ModeChosen;
    trigger ModeChosen2;
    trigger Voting;
    trigger SkinStuff;
    trigger OpenSkinMenu;
    trigger CloseSkinMenu;
    trigger SpawnPlayer1;
    trigger SpawnPlayer2;
    trigger SpawnPlayer3;
    trigger SpawnPlayer4;
    trigger SpawnPlayer5;
    trigger SpawnPlayer6;
    trigger InitializeTeirs;
    trigger CivGamble;
    trigger SpawnZergling;
    trigger SpawnSCV;
    trigger SpawnBaneling;
    trigger SpawnMedic;
    trigger SpawnWidowMine;
    trigger SpawnPreserver;
    trigger SpawnObserver;
    trigger SpawnAlmostDeadPenguin;
    trigger SpawnScourge;
    trigger SpawnFirebat;
    trigger SpawnOracle;
    trigger SpawnSentry;
    trigger SpawnMarine;
    trigger SpawnWarpPrism;
    trigger SpawnRoach;
    trigger SpawnCorruptor;
    trigger SpawnVulture;
    trigger SpawnReaper;
    trigger SpawnHydralisk;
    trigger SpawnHighTemplar;
    trigger SpawnDarkTemplar;
    trigger SpawnLurker;
    trigger SpawnStalker;
    trigger SpawnPhoenix;
    trigger SpawnRaven;
    trigger SpawnMarauder;
    trigger SpawnBattleCruiser;
    trigger SpawnViper;
    trigger SpawnTank;
    trigger SpawnViking;
    trigger SpawnVoidRay;
    trigger SpawnUltralisk;
    trigger SpawnImmortal;
    trigger SpawnBanshee;
    trigger SpawnMutalisk;
    trigger SpawnCarrier;
    trigger SpawnGoliath;
    trigger SpawnGhost;
    trigger SpawnSwarmHost;
    trigger SpawnThor;
    trigger SpawnInfestor;
    trigger SpawnColossus;
    trigger SpawnBroodLord;
    trigger SpawnTempest;
    trigger SpawnScout;
    trigger SpawnMinerals;
    trigger CreateLeviathanMid;
    trigger DestroyAllPhotons;
    trigger ForceGoBuy;
    trigger ForceStopBuy;
    trigger ForceMiddleBuy;
    trigger Turntechpenguinspawnoff;
    trigger Turntechpenguinspawnon;
    trigger PlayerLeaves;
    trigger Initialization;
    trigger BlowUpBaseDefenses;
    trigger ResetScore;
    trigger UnitsEvents;
    trigger EventsUnits;
    trigger CivEscapes;
    trigger Displayinfo;
    trigger Help;
    trigger TransferCivs;
    trigger SpawnBonusMinerals;
    trigger BonusRes;
    trigger GiveResTeam;
    trigger GiveRes;
    trigger ForceGo;
    trigger ForceInvulnerableOff;
    trigger ForceStop;
    trigger ForceMiddle;
    trigger TopLeft;
    trigger TopRight;
    trigger TopMid;
    trigger BottomLeft;
    trigger BottomRight;
    trigger BottomMid;
    trigger Mid;
    trigger Player1Enemy;
    trigger Player2Enemy;
    trigger Player3Enemy;
    trigger Player4Enemy;
    trigger Player5Enemy;
    trigger Player6Enemy;
    trigger TutorialInitialization;
    trigger TutorialBClicked;
    trigger Tutorial;
    trigger UnitHealthInit;
    trigger HealthUprade;
    trigger ArmorUpgrade;
    trigger SpawnRateUpgradeFast;
    trigger SpawnRateUpgradeFaster;
    trigger SpawnRateUpgradeNorm;

    Any idea what is wrong with the above?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Disabling single unit functionality?

    So how can I disable all animations for single unit?(without making a separate actor and unit)

    Posted in: Triggers
  • 0

    posted a message on Replace MapScript.galaxy with own

    I just removed/renamed all my functions with reserved names. It still crashes for some reason, I think it is because I include "LibGAx3" in my code. I am currently using battlenet to access that dependency when I load up my map. I know my script has a few errors, however, I cannot fix them unless I can compile the script to see my errors lol. Any ideas? I can let you see the script and my setup if that would be useful.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    @ImperialGood: Go

    Okay I saved map in unpacked format. I made a custom script and included my .galaxy file in it. I hit save and it crashes. Any ideas?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    @ImperialGood: Go

    Can you give me an example of the import statement? I have never used it in galaxy. Do you mean include?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    @ImperialGood: Go

    Thanks for the reply. Well the thing is, I basically have the code for the whole map in my new MapScript.galaxy. My map has all the trigger stuff in there still. What are the steps I need to take to have a blank MapScript.galaxy and have all my other code in the other one and include it? I have no idea how to include the script as an auxillary and/or any steps necessary for my map.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Replace MapScript.galaxy with own

    How can I replace the base MapScript.galaxy for my map with a script I made from scratch? I cannot figure out how to do this... I overwrote the base in the folder and it didn't do anything. I also, tried opening the map and opening the script myself, I hit compile all and it crashes everytime...(compile causes editor to crash)

    Posted in: Galaxy Scripting
  • 0

    posted a message on GAx3 lib copy?

    Does anyone have a copy of GAx3? The link on this site for download is broken. I don't want to have to log into battle net every time and now, it wont let me just to modify a map script.

    Posted in: Triggers
  • 0

    posted a message on Function documentation

    @ImperialGood: Go

    Thanks for the reply! I think I almost have galaxy down( except for function/method names ).

    Posted in: Galaxy Scripting
  • 0

    posted a message on Function documentation

    Does implicit casting from char to int work?(want to store player as a char)

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