Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: HiggsBoson12 on October 30, 2014, 01:50:13 PM

Title: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on October 30, 2014, 01:50:13 PM
I have a CRPL core that will be performing an essential part in my map "Saving Humanity Part 6." The supposed job is to take in a ton of ammo packets, and then spit out AntiCreeper. I was debugging the script, and the unit will not request ammo packets from my command node, whether it is from the CN itself, or through a collector. It shows the network connected line, but won't request ammo packets. I am using v 2.08 of the game. Here is the partial script.
#declare all of the constants that might be needed
once
#IMPORTANT CONSTANTS
Self CONST_CANREQUESTAMMO True SetUnitAttribute
Self CONST_CONNECTABLE True SetUnitAttribute


Self CONST_COUNTSFORVICTORY False SetUnitAttribute

#IMPORTANT CONSTANT
Self CONST_MAXAMMO 3000 SetUnitAttribute

Self CONST_NULLIFIERDAMAGES False SetUnitAttribute

#IMPORTANT CONSTANTS
Self CONST_PACKETREQUESTDELAY 10 SetUnitAttribute
Self CONST_SHOWAMMOBAR True SetUnitAttribute
Self CONST_AMMO 0 SetUnitAttribute
endonce

Self CONST_AMMO 3000 eq if
CurrentCoords -1000 AddCreeper
Else
"Needs to charge" SetPopupText
endif
P.S. It also does not show the ammo bar, although I don't know if this is a side effect, or something else that I haven't got right. Issues not related to the whole requesting ammo thing may exist, but the main focus is the ammo portion. I think I know how to fix anything else. Still, I would appreciate any help.
Title: Re: Cannot get CRPL core to request ammo
Post by: stdout on October 30, 2014, 01:57:23 PM
Quote from: HiggsBoson12 on October 30, 2014, 01:50:13 PM
Self CONST_AMMO 0 SetUnitAttribute

Wouldn't that line set the ammo in the core to 0 every frame?
Title: Re: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on October 30, 2014, 02:11:48 PM
Quote from: stdout on October 30, 2014, 01:57:23 PM
Quote from: HiggsBoson12 on October 30, 2014, 01:50:13 PM
Self CONST_AMMO 0 SetUnitAttribute

Wouldn't that line set the ammo in the core to 0 every frame?
I thought i stuck it inside a "once" and "endonce" section so it would only execute once.  :-\
Title: Re: Cannot get CRPL core to request ammo
Post by: stdout on October 30, 2014, 03:06:19 PM
You're right, I misunderstood what once did.

Hopefully someone who knows what they are talking about will have your answer. :)
Title: Re: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on October 30, 2014, 03:31:00 PM
Thank you for trying. I just don't understand why my CN refuses to send ammo packets. Maybe the robots are on strike  ;D
Title: Re: Cannot get CRPL core to request ammo
Post by: Grayzzur on October 30, 2014, 03:37:08 PM
You also need to set CONST_REQUESTPACKETS  to true. That's sort of the master switch for energy and ammo.
Title: Re: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on November 01, 2014, 03:47:55 PM
THANK YOU!  I will try this out soon!
Title: Re: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on November 01, 2014, 03:51:40 PM
It didn't work :O
Title: Re: Cannot get CRPL core to request ammo
Post by: Somebeing on November 02, 2014, 12:20:48 PM
Maybe you can check these boxes that I attached and make sure that the ones you want are checked. Just select the CRPL core and scroll down.

It is sort of a stupid idea, but it actually worked for me. Check it, save the map and it might work.

Bloody two years and I never knew you could scroll down and check those boxes...grumble grumble.

Good luck!
Title: Re: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on November 03, 2014, 09:32:25 AM
Thanks, I will try that as soon as I can, and then I will let you know.
Title: Re: Cannot get CRPL core to request ammo
Post by: HiggsBoson12 on November 04, 2014, 08:41:21 AM
I did it, and it worked! Thank you for your help!  ;D ;D ;D