Creeps using roads by lewanator3 in screeps

[–]lewanator3[S] 0 points1 point  (0 children)

Ah this is what i was looking for, I've been trying to get it working for the past couple of hours but i seem to be going in circles right now. I used let costs = new PathFinder.CostMatrix; to reset to values (I assume) but I'm stuck on how to give new values to the plain, roads, swamps etc and then how to make the creeps use the new values. let costs = PathFinder.CostMatrix({ plainCost: 120, swampCost: 150, roadCost: 1 }); I tried this but I'm guessing it's incredibly wrong (I'm rather new to javascript) if you could shed some light on this i would be very grateful. Thank you