Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: TripleKings on June 14, 2016, 06:53:54 PM

Title: Code Request
Post by: TripleKings on June 14, 2016, 06:53:54 PM
I need a script that adds 50 anticreeper to a random location, but requires and uses up anticreeper packets. If possible, it should also act as a shielding/emitting Idol, like in the Apex: Meso mission. The shielding range should at least be like the large Idol.
Title: Re: Code Request
Post by: Sorrontis on June 14, 2016, 07:43:52 PM
Quick question, you are using the latest version of CW3 right? I was helping another player with an older version and things can get messy.
Title: Re: Code Request
Post by: GoodMorning on June 15, 2016, 12:45:17 AM
Borrow from Meso, and copy the ammo request commands, making them the AC variants.

Then add this:

Self CONST_AMMOAC GetUnitAttribute ->ACAmmo
<-ACAmmo 50 gt if
  RandCoords -50 AddCreeper
  Self CONST_AMMOAC <-ACAmmo 50 sub SetUnitAttribute
endif


Make sense?
Title: Re: Code Request
Post by: Builder17 on June 15, 2016, 04:56:44 AM
I think requires ACAMMO doesn't persist in saves , code needs :

:GameLoaded
Self Const_RequiresACAmmo True SetUnitAttribute


Title: Re: Code Request
Post by: GoodMorning on June 15, 2016, 10:10:26 PM
Perhaps it's easier to dump it in :awake.
Title: Re: Code Request
Post by: TripleKings on July 05, 2016, 04:32:52 PM
But how do you even find the code in Meso?
Title: Re: Code Request
Post by: Builder17 on July 05, 2016, 05:26:48 PM
http://knucklecracker.com/wiki/doku.php?id=crpl:examine_map_resources

You could try use forum search here in knucklecracker to find is your question answered already?  :)