Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: TLFP on January 22, 2016, 09:00:11 PM

Title: How to summon a Emitter and destroy the PZ at the same time? {SOLVED}
Post by: TLFP on January 22, 2016, 09:00:11 PM
Question in title. If anyone wants to create a script for this I will credit whoever makes a working program.
Title: Re: How to summon a Emitter and destroy the PZ at the same time.
Post by: Nicant on January 22, 2016, 09:39:11 PM
Here's a start to the code! ;D (No idea how to have it remove the powerzone though :P )
# PowerlessEmitter.crpl
# Created on: 1/22/2016 9:12:10 PM
# ------------------------------------------

$ProductionInterval:20
$ProductionAmt:15
$StartTime:30

once
Self CONST_COUNTSFORVICTORY true SetUnitAttribute
Self CONST_NULLIFIERDAMAGES true SetUnitAttribute
Self CONST_TAKEMAPSPACE true SetUnitAttribute
Self CONST_CREATEPZ false SetUnitAttribute #This dosen't destroy the emitter's PowerZone!
Self "main" "NONE" SetImage


"EMITTER" CurrentCoords CreateUnit ->Emitter
<-Emitter 0 "productionInterval" <-ProductionInterval
<-Emitter 0 "productionAmt" <-ProductionAmt
<-Emitter 0 "startTime" <-StartTime
endonce

<-Emitter CONST_ISDESTROYED GetUnitAttribute if
"POWERZONE" CurrentCoords CreateUnit ->Zone
<-Zone 0 Destroy
endif
Title: Re: How to summon a Emitter and destroy the PZ at the same time.
Post by: Builder17 on January 23, 2016, 02:20:48 AM
You are meaning like in PAC maps when player creates new emitter or spore tower?
What this script should do?
Title: Re: How to summon a Emitter and destroy the PZ at the same time.
Post by: TLFP on January 23, 2016, 07:39:47 AM
Quote from: Builder17 on January 23, 2016, 02:20:48 AM
You are meaning like in PAC maps when player creates new emitter or spore tower?
What this script should do?
I want to create a rebuilding emitter that only rebuilds if there is digitalis under the PZ.
Title: Re: How to summon a Emitter and destroy the PZ at the same time?
Post by: Builder17 on January 23, 2016, 08:21:17 AM
I am doing pretty similar unit into one of my own maps.
Title: Re: How to summon a Emitter and destroy the PZ at the same time?
Post by: TLFP on January 23, 2016, 08:31:19 AM
Quote from: Builder17 on January 23, 2016, 08:21:17 AM
I am doing pretty similar unit into one of my own maps.
(insert amazement here) I figured someone would come up with the exact same idea. The way I'm trying to do it is there's a hidden script that checks to see if there is a PZ under it and if so, will then check for full health digitalis and then rebuild the emitter and destroy the PZ.
Title: Re: How to summon a Emitter and destroy the PZ at the same time?
Post by: Builder17 on January 24, 2016, 03:08:28 AM
You need to change some unit attributes from core settings in editor , but I think you know how.
It's better you put these if there isn't very much cores with this script.
Title: Re: How to summon a Emitter and destroy the PZ at the same time?
Post by: TLFP on January 24, 2016, 09:55:37 AM
Quote from: Builder17 on January 24, 2016, 03:08:28 AM
You need to change some unit attributes from core settings in editor , but I think you know how.
It's better you put these if there isn't very much cores with this script.
Thanks, it works! I'll credit you in my map and map list!