Finding a unitdef metal cost in an *A mod [solved]

Finding a unitdef metal cost in an *A mod [solved]

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
Bla
Posts: 79
Joined: 25 Feb 2013, 14:44

Finding a unitdef metal cost in an *A mod [solved]

Post by Bla »

in the spring java wrapper thing, given UnitDef uni and EngineCallback cb, to find the cost in metal I do
uni.findCost(cb.getResourceByName("metal"))
but I keep getting NullPointerException.

Is the resource name not "metal"?
Last edited by Bla on 15 May 2014, 00:21, edited 1 time in total.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Finding a unitdef metal cost in an *A mod

Post by gajop »

try "Metal" instead
Bla
Posts: 79
Joined: 25 Feb 2013, 14:44

Re: Finding a unitdef metal cost in an *A mod

Post by Bla »

Hey, works thanks!
Post Reply

Return to “AI”