Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Mexxor on November 20, 2014, 07:24:42 AM

Title: emitters and AoO factories
Post by: Mexxor on November 20, 2014, 07:24:42 AM
Hi,
I remember vaguely that there is a map where the emitters do not leave a powerzone, anyone know what map that is or better, has the script for that?
I have lots of emitters in m next map coming and to make things more balanced I want the emitters to not leave a powerzone when destroyed ::)

Also for the convertfactory, is there a way to change the ammo to ac, so it requests acpackets instead of ammo packets? Can I just replace "ammo"with "ac"or should i go about it differently?

Thanks in advance
Title: Re: emitters and AoO factories
Post by: pawel345 on November 20, 2014, 08:07:22 AM
In the Pass the map 3 there was a script like that, and 4 also i think. As for the other thing yes you can change form ammo to AC but remember to change it everywhere, in the canrequestac parameter and so on.
Title: Re: emitters and AoO factories
Post by: Mexxor on November 20, 2014, 10:06:26 AM
Thanks for the help :) I'll look into the pass the map map
Title: Re: emitters and AoO factories
Post by: iwishforpie2 on November 20, 2014, 10:16:26 AM
Use CONST_AMMOAC and replace each word that says CONST_AMMO. I think that will do it.
Title: Re: emitters and AoO factories
Post by: Mexxor on November 20, 2014, 10:27:15 AM
Quote from: iwishforpie2 on November 20, 2014, 10:16:26 AM
Use CONST_AMMOAC and replace each word that says CONST_AMMO. I think that will do it.

Thanks, gonna try that in a few hours :)
Title: Re: emitters and AoO factories
Post by: Mexxor on November 20, 2014, 10:56:34 AM

# FreezeFactory.crpl
# Created on: 6/7/2014 5:30:54 PM
# ------------------------------------------

once
Self CONST_CONNECTABLE 1 SetUnitAttribute
Self CONST_REQUESTPACKETS 0 SetUnitAttribute
Self CONST_NULLIFIERDAMAGES 0 SetUnitAttribute
Self CONST_COUNTSFORVICTORY 0 SetUnitAttribute
Self CONST_ISBUILDING 1 SetUnitAttribute
Self CONST_HEALTH 0 SetUnitAttribute
"C" SetText
192 192 192 255 SetTextColor
0 SetTextX
-2 SetTextY
1 ->trigger
1 OperateWhilePaused
endonce

0 GetMouseButtonDown if
GetMouseCell ->y ->x
<-y CurrentY sub abs 2 lte if
<-x CurrentX sub abs 2 lte if
Self CONST_REQUESTPACKETS GetUnitAttribute if
Self CONST_REQUESTPACKETS 0 SetUnitAttribute
"Misc27" PlaySound
192 192 192 255 SetTextColor
else
Self CONST_REQUESTPACKETS 1 SetUnitAttribute
"Misc24" PlaySound
192 0 0 255 SetTextColor
endif
endif
endif
endif

Self CONST_ISBUILDING GetUnitAttribute eq0 if
<-trigger if
"AOO" CurrentCoords 4 sub CreateUnit ->aoo
<-aoo 0 "TYPE" "CONVERT" SetScriptVar
<-aoo CONST_ISBUILDING 0 SetUnitAttribute
"Misc28" PlaySound
3 CurrentPixelCoords 32 add -3 1 1 0.03 CreateEffect
0 ->trigger
endif
<-aoo CONST_ISDESTROYED GetUnitAttribute if
1 ->trigger
Self CONST_ISBUILDING 1 SetUnitAttribute
Self CONST_BUILDCOST "AC" 600 SetUnitAttribute
endif
endif

:awake
1 OperateWhilePaused


Ehm, i got it to accept ac instead of ammo, but now it fills up to whatever I put in the "max ac ammo" thing and then just constantly makes a new convert whenever you collect the other :O
Title: Re: emitters and AoO factories
Post by: iwishforpie2 on November 20, 2014, 11:01:52 AM
The problem is stuff cannot be built by AC, you'll have to make it detect its AC ammo and produce the AoO.
Title: Re: emitters and AoO factories
Post by: Mexxor on November 20, 2014, 11:21:26 AM
hmm, so what can be done with acpackets other than bombers and sprayers?