Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Vanguard on April 18, 2014, 07:05:14 AM

Title: Possible Bug in SetTechtArtifactType with Pulsecannons
Post by: Vanguard on April 18, 2014, 07:05:14 AM
I decided to open a new topic instead of using the old one (http://knucklecracker.com/forums/index.php?topic=16041.0), which is a seperate issue from this one.

Proof of Concept


# This code shows that Pulsecannon as an argument to SettechArtifact is bugged
# The List of Arguments was taken from the SetTechArtifactType Page via Copy and Pasta (yumm!)
# http://knucklecracker.com/wiki/doku.php?id=crpl:docs:settechartifacttype
once
"COLLECTOR,RELAY,REACTOR,OREMINE,SIPHON,TERP,GUPPY,PULSECANNON,MORTAR,STRAFER,
BOMBER,SPRAYER,NULLIFIER,SHIELD,BEAM,SNIPER,FORGE,BERTHA,THOR,COMMANDNODE" "," split ->UnitList
<-UnitList GetListCount 0 do
"TECHARTIFACT" I 1 add 3 mul 45 CreateUnit ->id
<-id <-UnitList I GetListElement SetTechArtifactType
<-id 0 "COUNT" I setscriptvar
loop
endonce


As you can see in the picture, Nr. 7 does not have a Pulsecannon Image and when selected shows as "COLLECTOR" which seems to be the default tech type for Artifacts.

Can someone please confirm, that it isn´t just me being stupid again?  :-[
Title: Re: Possible Bug in SetTechtArtifactType with Pulsecannons
Post by: knucracker on April 18, 2014, 07:42:10 PM
Looking at the game code, looks like the type should be "CANNON" rather than "PULSECANNON" for the call to SetTechArtifactType.
Title: Re: Possible Bug in SetTechtArtifactType with Pulsecannons
Post by: Vanguard on April 19, 2014, 08:10:25 AM
Ok, Cannon works. Thanks. I posted a comment on the Wiki page, so others won´t have the same problem.
Title: Re: Possible Bug in SetTechtArtifactType with Pulsecannons
Post by: asmussen on April 19, 2014, 01:03:26 PM
I've corrected the error on the CRPL reference page for SetTechArtifactType on the wiki.

I also noticed that PULSECANNON is listed as a unit type for both the GetUnitType and CreateUnit commands in the reference. Should those be CANNON as well?
Title: Re: Possible Bug in SetTechtArtifactType with Pulsecannons
Post by: knucracker on April 19, 2014, 01:21:40 PM
I think the other references are right.  I was jut brain dead when I did the SetTechArtifactType command.  It really shouldn't even have been a separate command, but I did it before the support for attributes.
Title: Re: Possible Bug in SetTechtArtifactType with Pulsecannons
Post by: planetfall on April 19, 2014, 01:32:18 PM
Confirmed that GetUnitType and CreateUnit use "PULSECANNON".