Search

Search found 6 matches

by hach-que
22 Aug 2008, 20:07
Forum: Help & Bugs
Topic: Random bad std::alloc
Replies: 2
Views: 759

Random bad std::alloc

I randomly get a crash with the message "bad std::alloc". No crash data is printed to infolog.txt and I have ground decals all the way onto 0.

My NVIDIA drivers are the latest and I've done both the dual-core and NVIDIA fixes that are required.

Does anyone know what might cause this?
by hach-que
02 Aug 2008, 12:34
Forum: Lua Scripts
Topic: Finding the nearest positive integer in a 2-dimension array
Replies: 8
Views: 691

Re: Finding the nearest positive integer in a 2-dimension array

I suppose I can do the search circle method, and then search connecting metal positions for the highest amount of metal in that spot.
by hach-que
02 Aug 2008, 11:30
Forum: Lua Scripts
Topic: Finding the nearest positive integer in a 2-dimension array
Replies: 8
Views: 691

Re: Finding the nearest positive integer in a 2-dimension array

I've actually done the same thing before. Specifically from my gadget: 46 local metalMapScale = 16 ... 168 local function GetMetalMapCoords(posX, posZ) 169 return math.floor(posX / metalMapScale), math.floor(posZ / metalMapScale) 170 end So just divide the (x, z) coordinates by 16. Although I suppo...
by hach-que
02 Aug 2008, 10:09
Forum: Lua Scripts
Topic: Finding the nearest positive integer in a 2-dimension array
Replies: 8
Views: 691

Re: Finding the nearest positive integer in a 2-dimension array

I checked the WIKI and the Lua documentation, and I don't understand what you are referring too. Can you provide a link?
by hach-que
02 Aug 2008, 06:12
Forum: Lua Scripts
Topic: Finding the nearest positive integer in a 2-dimension array
Replies: 8
Views: 691

Finding the nearest positive integer in a 2-dimension array

With all the help from #lua, I've managed to load all the values of how much metal there is in a position into a 2D map (excluding locations where there is no metal, to speed up the search process), but now I need to get the nearest position in that 2D map (2-dimension array) based on a unit's locat...
by hach-que
01 Aug 2008, 11:05
Forum: Lua Scripts
Topic: Spring table and map functions
Replies: 1
Views: 445

Spring table and map functions

First off, I couldn't find in the documentation a list of any functions in the Spring table, yet there are functions used in the metal maker manager widget, and second, I need to know whether there is a way to grab the nearest location of a metal deposit.

Go to advanced search