Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Builder17 on November 01, 2015, 03:23:38 PM

Title: Thor is impossible to destroy?
Post by: Builder17 on November 01, 2015, 03:23:38 PM
I would like way to destroy thor in PAC map , but it seems it's impossible.
Any idea?
Title: Re: Thor is impossible to destroy?
Post by: Nicant on November 01, 2015, 04:04:57 PM
This simple Command. Not sure if it will work but this would be my guess.
# 0 means no explosion and no sound, 1 means a small soundless flash, 2 means a full explosion with sound, 3 means full explosion but no sound.
THOR 2 Destroy
Title: Re: Thor is impossible to destroy?
Post by: Builder17 on November 02, 2015, 03:13:38 AM
I though about CRPL core what player needs to connect digitalis and after it's connected thor will blown itself ,but how Core can know where thor is located in map?
Title: Re: Thor is impossible to destroy?
Post by: J on November 02, 2015, 10:23:55 AM
The Destroy command takes an unit UID, not the name of the unit. I don't know if GetUnitsInRange also returns thors, but if it does you can get the UID and destroy it.
Title: Re: Thor is impossible to destroy?
Post by: Builder17 on November 02, 2015, 12:19:39 PM
GetUnitsInRange returns the unit UID's of all built player units that are landed and within range.
Thor isn't landed, I think. But can GetUnitType work?
Title: Re: Thor is impossible to destroy?
Post by: J on November 02, 2015, 01:11:22 PM
GetUnitType requires the UID of a unit, which is the thing we're missing. Once you have the UID you can use GetUnitType to check if it is a thor.
GetAllUnitsInRange does return flying units (and also enemy units). Call that function, and use a loop to find the thor in the list. This should work:

GetAllUnitsInRange(0 0 9999 0) 0 do
->unit
if(GetUnitType(<-unit) "THOR" eq)
<-unit 2 Destroy
endif
loop
Title: Re: Thor is impossible to destroy?
Post by: Nicant on November 02, 2015, 03:07:53 PM
Quote from: J on November 02, 2015, 10:23:55 AM
The Destroy command takes an unit UID, not the name of the unit. I don't know if GetUnitsInRange also returns thors, but if it does you can get the UID and destroy it.
oh ok i did not know it couldn't
Title: Re: Thor is impossible to destroy?
Post by: Hubs on November 03, 2015, 02:41:33 PM
You should be able to create a thor through crpl and capture the unit id that way. Or just find units in range and get the type. You could create a core that always moves to the thor's current position (if it's moving) and have it track when creeper is in that cell and damage thor's health based on creeper levels. Once health is depleted, destroy the thor.

For the movement, I'm not sure if the movement commands would work on thor, but if they do, you could create a script that has thor patrol between points or even moves to the deepest creeper on the map. Then also have it track ammo and return to the CN to resuplly if low.  I've thought about this alot because I plan on using something like this in later PAC Redemption maps. 
Title: Re: Thor is impossible to destroy?
Post by: warren on November 05, 2015, 03:34:10 AM
Before I would do that (destroy thor) I would test to see if the thor is automatically destroyed when the thor's health is depleted.