Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: Nicant on May 06, 2017, 07:47:09 PM

Title: Anyone know how to make this work?
Post by: Nicant on May 06, 2017, 07:47:09 PM
I am working on a missile tower idea (That could possibly be used in a future map of mine) that does not work. The Missile flys into particles, but does not damage the particles. So to make the Missile damage the particles, i have a blue particles constantly teleporting to the missiles when they spawn. The Missile still flys and functions, but the part where the blue particle spawns does not. Here is the code for it.

# --Missile-- 5/6/2017 5:08:55 PM

GetTimer0 eq0 if
"Missile" CurrentCoords CreateUnit ->Missile #Creates Missile
CreateParticle(False 1 2 90 CurrentPixelCoords) ->Particle
InitMissile(False GetParticlesInRange(1 1 30 CurrentX CurrentY) <-Missile) #Tells Missile what it's target is.
30 SetTimer0
endif
TeleportParticle(0 0 GetUnitPixelCoordY(<-Missile) GetUnitPixelCoordX(<-Missile) <-Particle)


Any help will be greatly appriciated! :)

Edit: I've realized one mistake on this. I used cell coords instead of pixel coords, but it still does not create particles. I've updated the code above...
Title: Re: Anyone know how to make this work?
Post by: GoodMorning on May 06, 2017, 08:01:49 PM
There seems to be one key change, which I will illustrate here.
You have warp notation used like so:

Command (Arg Arg Arg Y X)


Either of these should work:

X Y Arg Arg Arg Command
Command (X Y Arg Arg Arg)


You've probably been looking at the wiki pages, where the X and Y are extracted from the stack last. This is so, but it is that way because the "Arg" arguments are on top of the stack and are read off first. So you have arguments in reverse order.

Probably it would be best to read up on warp notation. http://knucklecracker.com/wiki/doku.php?id=crpl:overview#warp_notation
Title: Re: Anyone know how to make this work?
Post by: Nicant on May 06, 2017, 08:08:37 PM
Quote from: GoodMorning on May 06, 2017, 08:01:49 PM
There seems to be one key change, which I will illustrate here.
You have warp notation used like so:

Command (Arg Arg Arg Y X)


Either of these should work:

X Y Arg Arg Arg Command
Command (X Y Arg Arg Arg)


You've probably been looking at the wiki pages, where the X and Y are extracted from the stack last. This is so, but it is that way because the "Arg" arguments are on top of the stack and are read off first. So you have arguments in reverse order.

Probably it would be best to read up on warp notation. http://knucklecracker.com/wiki/doku.php?id=crpl:overview#warp_notation

Thank you it now works! :) That has to be the fifth time i have fallen for that mistake :P