Quote from Kueken531:
Ah, the new and delete statements are explained in the pointers section. I tried to find them in the struct section.
A suggestion: Would it be possible to include the Galaxy++ code in the map? Maybe as custom script or comment files, in the same folder structure you used in the G++ editor? This way, you have all your script in the map, and maybe you could add functionality to extract this script from the map to your editor; this way the additional script files would become obsolete.
Its not desperately needed, though, but it might be very convenient. You could make this optional as well.
----
Like uncompiled? Because when you compile and run it should be compiled and in the output map?
Edit: would it be possible to make it possible to compile via a command line? That way it could work cross-platform aswell as making it possible to use any editor of choice. I would also probably contribute with a plugin for some other editor if this was implemented.
Speaking of update, it seems the editor crashes all the time once I've auto updated which makes me have to reinstall the editor. I'll send you a crash report on the next update
gives me "The left side of the . must be of type struct, class, or something which is enriched" on the line #this.pri = prix. You may also need this to figure out the error. Removing the #this like you've done in the example gives me "unable to use struct fields outside of methods".
void priorityMine (unit u) {}
#trigger priorityAddMine {
#events {}
#actions
{
int pri = priorityInd;
int pl = EventPlayer ();
int p = pl-1;
typedefWorker wo;
pFuncD test = #delegate<pFuncD>(testfunc);
for (int x=0; x<=10; x++) {
//if no worker avail is will queue the order so that
//when worker is avail it will pick up the mission
if (Worker[p][x].avail) {
wo = Worker[p][x];
wo.avail = false;
if (x==10); {
priorityQueueInsert (p, #new priorityStruct (priorityPr[p][0], test ));
}
}
}
}
Edit: Realised that I had not added the #trigger line, it seems when you want to add that afterwords it will replace the previous line so for instance if you type out "bool blablabla ()" and then afterwards add the #trigger to the line it will replace the "bool"
Hello, I've started using your editor and well it crashed for me when writing this code. Essentially since there's no documentation it's quite hard to know how to code it properly. I think it crashes at the for line.
I think the # are kinda ugly. It wouldn't hurt to get rid of them tbh.
Quote from Kueken531:
Ah, the new and delete statements are explained in the pointers section. I tried to find them in the struct section.
A suggestion: Would it be possible to include the Galaxy++ code in the map? Maybe as custom script or comment files, in the same folder structure you used in the G++ editor? This way, you have all your script in the map, and maybe you could add functionality to extract this script from the map to your editor; this way the additional script files would become obsolete.
Its not desperately needed, though, but it might be very convenient. You could make this optional as well.
----
Like uncompiled? Because when you compile and run it should be compiled and in the output map?
Awesome! That'll come to use!
Edit: would it be possible to make it possible to compile via a command line? That way it could work cross-platform aswell as making it possible to use any editor of choice. I would also probably contribute with a plugin for some other editor if this was implemented.
Awesome, thanks for the quick update!
Speaking of update, it seems the editor crashes all the time once I've auto updated which makes me have to reinstall the editor. I'll send you a crash report on the next update
I sent you a crash report, I can send you the complete code if you need (dunno if that was included in the report).
alright thanks, now I'm trying to use the enrichment constructor though.
typedef unit typedefWorker;
#enrich typedefWorker {
bool avail {
#get { return #this.avail }
#set { #this.avail = #value; }
}
unit typedefWorker (int p, point P){
#this.avail=true;
return libNtve_gf_CreateUnitsAtPoint2(1, "Worker", 0, p, P);
}
}
typedefWorker[4][10] Worker;
Worker[x][y] = #new typedefWorker (x, Point(0,0));
I guess I'm not doing it correctly, however it's unclear how else to do it :S
struct priorityStruct {
pFuncD pFunc;
int pri;
priorityStruct (int prix, pFuncD pf) {
#this.pri = prix;
#this.pFunc = pf;
}
}
gives me "The left side of the . must be of type struct, class, or something which is enriched" on the line #this.pri = prix. You may also need this to figure out the error. Removing the #this like you've done in the example gives me "unable to use struct fields outside of methods".
void priorityMine (unit u) {}
#trigger priorityAddMine {
#events {}
#actions
{
int pri = priorityInd;
int pl = EventPlayer ();
int p = pl-1;
typedefWorker wo;
pFuncD test = #delegate<pFuncD>(testfunc);
for (int x=0; x<=10; x++) {
//if no worker avail is will queue the order so that
//when worker is avail it will pick up the mission
if (Worker[p][x].avail) {
wo = Worker[p][x];
wo.avail = false;
if (x==10); {
priorityQueueInsert (p, #new priorityStruct (priorityPr[p][0], test ));
}
}
}
}
@SBeier:
oh yeah I did, thanks!
Awesome!
Are constructers possible for enrichments?
edit2:
int iy;
w = EventUnit();
i = FixedToInt(UnitGetCustomValue(w,UNIT_WALL_IND);
It says "expecting ')'"
full script is here http://paste.sc2mapster.com/co59bga8nqdh3krs/ the error is at line 77
@SBeier: Go
It'd be cool if you added enrichments like in andromeda. Especially now with typedefs.
IMO those stuff would be great to have, especially array pointers.
Edit: Realised that I had not added the #trigger line, it seems when you want to add that afterwords it will replace the previous line so for instance if you type out "bool blablabla ()" and then afterwards add the #trigger to the line it will replace the "bool"
Hello, I've started using your editor and well it crashed for me when writing this code. Essentially since there's no documentation it's quite hard to know how to code it properly. I think it crashes at the for line.