Just wanted to check something - am I correct in thinking that square brackets [] are used in SLIC only for accessing array members?
Announcement
Collapse
No announcement yet.
SLIC syntax
Collapse
X
-
So far as I know in Slic2 you use quare brackets to access members of arrays and indicate that the just definded variable is an array. From the Slic1 documentation I have this:
Regions
There are a number of functions above which act on regions. A region is a parallelogram or union of parallelograms on the map. They can be defined in two ways.
A simple region:
Region name [ x1,y2, x2, y2];
Or a complex region built from a union of any number of simple regions:
Region name = name1 + name2 [+ ... + namen]
WARNING: Regions have not been thoroughly tested, they may not work as advertised!
-MartinCiv2 military advisor: "No complaints, Sir!"
-
Weren't the regions part of the fuzzy-logic AI coding? As that isn't used in CtP2, it'd be a fair bet that regions are not used either.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
The CTP1 region functions are also present in CTP2 but I guess it is very unlikely that they do something, of course this has to be tested, but than I have to find out how to create a region. Of course these regions could be usefull for some stuff.
-MartinCiv2 military advisor: "No complaints, Sir!"
Comment
-
what is AI-fuzzy logic ?
dont answer if its like a massive explanation need not waste your timeOxygen should be considered a drug
Tiberian Sun Retro
My Mod for Tiberian Sun Webmaster of
http://www.tiberiumsun.com
Comment
-
Fuzzy logic is a means by which AI (Artificial Intelligence) can make decisions. It was used in CTP1, but not 2. It essentially entails a mathematical interpretation of statements like:
IF I'm at war AND I have few troops THEN I should build more troops.
The good thing about fuzzy logic is that it allows for statements to be partly true - they all have a truth value between 0 and 1 inclusive. This is very useful for interpreting "real world" statements, combining them and so forth. The only places where the fuzziness was really used in CTP1 was in the diplomacy (the rest used only the most crisp form of fuzzy logic it could), but it could have been applied to almost all of the decisions made.
WesW and some others spent hundreds of man-hours tweaking the CTP AI for the MedMod, but noone knows exactly what's going on since we don't know what implication rules and defuzzification methods were used (though we can make a fair guess).
Comment
-
I understand what your saying and can see definite advantages with using it (or the possibilities of using it) But then why did ctp not make much use of it and why was it tottaly excluded from ctp2. Is there so problems with it that we dont know about or something, surely they should have developed upon the system for ctp2????Oxygen should be considered a drug
Tiberian Sun Retro
My Mod for Tiberian Sun Webmaster of
http://www.tiberiumsun.com
Comment
-
I would guess because they hadn't actually made much use of the fuzziness before, they decided it was an unnecessary complication, but you'd have to ask those Apolyton members more intimately involved in the development.
In a way it's a shame they stopped using it because it's very powerful if used correctly, but on the other hand it's easy to get very confused as to what's going on, and it fairly complex to use.
Comment
-
Yes, I vaguely recall trying to use regions but failing. IIRC (but my memories on this are very vague and I lost any notes I made at the time) they're not even implemented in CtP2 (they barely were in CtP1 either).
IIRC fuzzy logic was thrown out to make things easier for the modmakers. It's great that they thought of us, but personally I think I would have preferred it if they had kept it in...
Comment
-
In case anyone was wondering why I cared, it's for the next generation of my SLIC template system. My target was to have a system able to auto-generate the unit-updater code arrays, and I have now achieved this goal (more or less). Just to demonstrate, this template:
Code:[*units.ces [?ObsoleteAdvance| OLD_UNIT_TYPE[[##]]=UnitDB([.Name]); [~ObsoleteAdvance enadv[[##]]=Advance_DB([.Name]); NEW_UNIT_TYPE[[##]]=UnitDB([~Consequences [?[.DB]=DATABASE_UNITS|[.Name]); PER_UNIT_UPDATE_COST[[##]]=[.ShieldCost];|][![?[.DB]=DATABASE_UNITS|!|]]][!!]] |][#[?ObsoleteAdvance|+|]]]
Code:OLD_UNIT_TYPE[0]=UnitDB(UNIT_ARCHER); enadv[0]=Advance_DB(ADVANCE_CANNON_MAKING); NEW_UNIT_TYPE[0]=UnitDB(UNIT_CANNON); PER_UNIT_UPDATE_COST[0]=1200; OLD_UNIT_TYPE[1]=UnitDB(UNIT_BOMBER); enadv[1]=Advance_DB(ADVANCE_ADVANCED_COMPOSITES); NEW_UNIT_TYPE[1]=UnitDB(UNIT_STEALTH_BOMBER); PER_UNIT_UPDATE_COST[1]=3375; OLD_UNIT_TYPE[2]=UnitDB(UNIT_CANNON); enadv[2]=Advance_DB(ADVANCE_CYBERNETICS); NEW_UNIT_TYPE[2]=UnitDB(UNIT_WAR_WALKER); PER_UNIT_UPDATE_COST[2]=3500; OLD_UNIT_TYPE[3]=UnitDB(UNIT_CARAVAN); enadv[3]=Advance_DB(ADVANCE_GLOBAL_ECONOMICS); NEW_UNIT_TYPE[3]=UnitDB(UNIT_Z_FREIGHT_TRANSPORT); PER_UNIT_UPDATE_COST[3]=1200; OLD_UNIT_TYPE[4]=UnitDB(UNIT_CARRACK); enadv[4]=Advance_DB(ADVANCE_INTERNAL_COMBUSTION); NEW_UNIT_TYPE[4]=UnitDB(UNIT_TROOP_SHIP); PER_UNIT_UPDATE_COST[4]=1200; OLD_UNIT_TYPE[5]=UnitDB(UNIT_CATAMARAN); enadv[5]=Advance_DB(ADVANCE_HULL_MAKING); NEW_UNIT_TYPE[5]=UnitDB(UNIT_LONGSHIP); PER_UNIT_UPDATE_COST[5]=630; OLD_UNIT_TYPE[6]=UnitDB(UNIT_CATAPULT); enadv[6]=Advance_DB(ADVANCE_EXPLOSIVES); NEW_UNIT_TYPE[6]=UnitDB(UNIT_ARTILLERY); PER_UNIT_UPDATE_COST[6]=1500; OLD_UNIT_TYPE[7]=UnitDB(UNIT_CAVALRY); enadv[7]=Advance_DB(ADVANCE_FUSION); NEW_UNIT_TYPE[7]=UnitDB(UNIT_FUSION_TANK); PER_UNIT_UPDATE_COST[7]=5250; OLD_UNIT_TYPE[8]=UnitDB(UNIT_CLERIC); enadv[8]=Advance_DB(ADVANCE_MASS_MEDIA); NEW_UNIT_TYPE[8]=UnitDB(UNIT_TELEVANGELIST); PER_UNIT_UPDATE_COST[8]=1200; OLD_UNIT_TYPE[9]=UnitDB(UNIT_DESTROYER); enadv[9]=Advance_DB(ADVANCE_PLASMA_WEAPONRY); NEW_UNIT_TYPE[9]=UnitDB(UNIT_PLASMA_DESTROYER); PER_UNIT_UPDATE_COST[9]=4500; OLD_UNIT_TYPE[10]=UnitDB(UNIT_DIPLOMAT); enadv[10]=Advance_DB(ADVANCE_EUGENICS); NEW_UNIT_TYPE[10]=UnitDB(UNIT_EMPATHIC_DIPLOMAT); PER_UNIT_UPDATE_COST[10]=1500; OLD_UNIT_TYPE[11]=UnitDB(UNIT_FIGHTER); enadv[11]=Advance_DB(ADVANCE_SUPERSONIC_FLIGHT); NEW_UNIT_TYPE[11]=UnitDB(UNIT_INTERCEPTOR); PER_UNIT_UPDATE_COST[11]=2500; OLD_UNIT_TYPE[12]=UnitDB(UNIT_FIRE_TRIREME); enadv[12]=Advance_DB(ADVANCE_MODERN_METALLURGY); NEW_UNIT_TYPE[12]=UnitDB(UNIT_IRONCLAD); PER_UNIT_UPDATE_COST[12]=1500; OLD_UNIT_TYPE[13]=UnitDB(UNIT_FRIGATE); enadv[13]=Advance_DB(ADVANCE_PLASMA_WEAPONRY); NEW_UNIT_TYPE[13]=UnitDB(UNIT_PLASMA_DESTROYER); PER_UNIT_UPDATE_COST[13]=4500; OLD_UNIT_TYPE[14]=UnitDB(UNIT_HOPLITE); enadv[14]=Advance_DB(ADVANCE_GUNPOWDER); NEW_UNIT_TYPE[14]=UnitDB(UNIT_INFANTRYMAN); PER_UNIT_UPDATE_COST[14]=1000; OLD_UNIT_TYPE[15]=UnitDB(UNIT_INFANTRYMAN); enadv[15]=Advance_DB(ADVANCE_ADV_INFANTRY_TACTICS); NEW_UNIT_TYPE[15]=UnitDB(UNIT_MARINE); PER_UNIT_UPDATE_COST[15]=1400; OLD_UNIT_TYPE[16]=UnitDB(UNIT_INTERCEPTOR); enadv[16]=Advance_DB(ADVANCE_AI_SURVEILLANCE); NEW_UNIT_TYPE[16]=UnitDB(UNIT_SPY_PLANE); PER_UNIT_UPDATE_COST[16]=2815;
Now, from that, can anyone work out the template syntax? .
Edit: Some strange new-lines and spaces have appeared in that which shouldn't be there...
Comment
-
Should there be an _ in Advance_DB ?Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
Comment