Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: piggood on June 21, 2019, 08:40:14 AM

Title: digitalis spreader not working
Post by: piggood on June 21, 2019, 08:40:14 AM
I was making a unit that moves to Where Digitalis exist and make a 3x3 digitalis growth there. but it doesn't move.
(Sorry I'm bad at english)
ShowTraceLog
CurrentX CurrentY 5 RandCoordsInRange ->x ->y
<-x <-y GetDigitalisGrowth ->hi
<-hi 1 eq if
1 trace
GetQueuedMoveCount ->hi
<-hi 0 eq if
<-x <-y 15 QueueMove
endif
endif
CurrentY 2 add CurrentY 1 sub do
  CurrentX 2 add CurrentX 1 sub do
    I J true SetDigitalisGrowth
  Loop
Loop
Title: Re: digitalis spreader not working
Post by: Builder17 on June 21, 2019, 10:04:53 AM
ShowTraceLog
CurrentX CurrentY 5 RandCoordsInRange ->y ->x
<-x <-y GetDigitalisGrowth ->hi
<-hi 1 eq if
1 trace
GetQueuedMoveCount ->hi
<-hi 0 eq if
<-x <-y 15 QueueMove
endif
endif
CurrentY 2 add CurrentY 1 sub do
  CurrentX 2 add CurrentX 1 sub do
    I J true SetDigitalisGrowth
  Loop
Loop


Changed coordinate order of RandCoordsInRange, try if this code would work any better. :)
Title: Re: digitalis spreader not working
Post by: piggood on June 21, 2019, 11:09:48 PM
Thanks! it worked!  :)