Page 1 of 1
Read squad file data directly from script
Posted: Tue Jul 09, 2013 9:28 am
by rf900
Was wondering if there are functions to access the squad file data directly without the need of an existing unit in the map. For example I want to get the cost of a unit which has the ID=x in the file (not ingame).
Re: Read squad file data directly from script
Posted: Mon Jul 15, 2013 4:42 pm
by pipfromslitherine
There isn't really any way to do this currently.
Cheers
Pip
Re: Read squad file data directly from script
Posted: Tue Jul 16, 2013 3:03 pm
by enric
I dont't know what are you trying to do but, you can place a unit out of map, get the cost, and remove the unit.
int id;
int cost;
PlaceUnit (10,10, 0, 0, 0, "cromwell") // place it out of boundaries
id = GetUnitOnTile(10, 10);
cost = GetUnitCost(id);
Log ("cost", id, cost); // check it
RemoveUnit(id, 1);
Re: Read squad file data directly from script
Posted: Wed Jul 17, 2013 6:30 am
by rf900
Yes, that is what I am doing right now. I basically wanted to avoid having to write the name of the units, for me it makes more sense to have a unique id per unit and use that as reference. That way you have more options to do random force deployment using indexes instead of strings, moreover as in the script there is no easy way to have string variables.