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)
You can in theory do it by opening the map in an MPQ editor and replacing the file then compacting. However the problem is when you go to publish the map the editor will rebuild it and in doing so discard the script.
I am not sure if you can. In any case you can always include your script as an auxiliary and import it.
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.
I do not think it is possible to have a "blank" map script as the GUI system will always want to create at least some code. What you can do however is use the import statement to import your bank as a file from the import manager. All you need to do is make sure your script avoids any of the template stuff GUI generates to avoid name clashes. You can then run your script with a custom script element where the initial function is set to the initial function you imported.
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.
the code generated by GUI alwys looks like "trigger gt_Map_Init;" maybe the gt_ is needed but i dunno otherwise =
same thing again, copy half of the code into GUI, check if it works, if yes copy the half of the 2nd half into GUI and see if it works and so on and on, until you got the piece that is crashing your thing.
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;
When I try to quote it the one ';' on the left disappears. It could be possible that it is different from the standard ';' symbol so the compiler ignores it.
I would need to see the entire function in proper code blocks (<<code galaxy>>CODE<</code>>) to check for anything else.
Could I have the global declarations that goes with that? Using both I can try to compile it myself and so run more active error finding. The error does not appear obvious so is likely something small.
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)
You can in theory do it by opening the map in an MPQ editor and replacing the file then compacting. However the problem is when you go to publish the map the editor will rebuild it and in doing so discard the script.
I am not sure if you can. In any case you can always include your script as an auxiliary and import it.
@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.
I do not think it is possible to have a "blank" map script as the GUI system will always want to create at least some code. What you can do however is use the import statement to import your bank as a file from the import manager. All you need to do is make sure your script avoids any of the template stuff GUI generates to avoid name clashes. You can then run your script with a custom script element where the initial function is set to the initial function you imported.
@ImperialGood: Go
Can you give me an example of the import statement? I have never used it in galaxy. Do you mean include?
Yes I probably meant include. Its like the one the generated script uses for the standard libraries.
@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?
go to trigger editor, right click, create new custom script, then write include "myFolder/myCode.galaxy"
that's all, if your code is well written it shouldn't crash.
Make sure that you do not have any functions with reserved names used by the editor's standard trigger system.
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.
copy parts of the code into GUI to test it. find your error, fix it.
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?
the code generated by GUI alwys looks like "trigger gt_Map_Init;" maybe the gt_ is needed but i dunno otherwise = same thing again, copy half of the code into GUI, check if it works, if yes copy the half of the 2nd half into GUI and see if it works and so on and on, until you got the piece that is crashing your thing.
@FunkyUserName: Go
I guess function overloading isnt supported. Thanks for the help.
What is there to guess about that?! C has never supported function overloading so it is implicit that Galaxy probably does not.
@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));
}
When I try to quote it the one ';' on the left disappears. It could be possible that it is different from the standard ';' symbol so the compiler ignores it.
I would need to see the entire function in proper code blocks (
<<code galaxy>>CODE<</code>>
) to check for anything else.Eg...
For some reason the tabs got really messed up in the paste...
Could I have the global declarations that goes with that? Using both I can try to compile it myself and so run more active error finding. The error does not appear obvious so is likely something small.
Here you go :D