Jump to content


Photo

How to get a buildings location ?


4 replies to this topic

#1 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 02 February 2005 - 01:58 PM

I want to get the location of turrets but didn't find a function for this. There are functions for bases, squads, slag etc so I guess I just missed it. Do you know ?

#2 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 02 February 2005 - 04:25 PM

What do you have? Building ID? Build channel?
Posted Image

#3 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 02 February 2005 - 04:44 PM

I want to count turrets near LPs like this

for build_channel in build_manager:GetBuildChannelAIs() do
	
  if self:IsTurret( build_channel:GetBlueprintID() ) and 
  distance_sqr(build_channel:GetPosition(), strat_pos) < 200 then
       
    num_turrets = num_turrets + 1
   end

But there is no build_channel:GetPosition()

#4 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 02 February 2005 - 10:03 PM

I have tried before with things like: will this thing has this method so this similar thing should also have the method. Nope.
Posted Image

#5 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 03 February 2005 - 06:43 PM

Prehaps this might work (untested):
for build_channel in build_manager:GetBuildChannelAIs() do



 if build_channel:GetBlueprintID() == cpu_manager.stats:GetEntityID( "relic_struct" ) then

    --Is relic

 else

    --Is not relic

 end

end

Posted Image



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users