Teleporting creeper?

Started by Coin_Star2, June 02, 2014, 05:13:10 PM

Previous topic - Next topic

Coin_Star2

Now, this will seem kinda nooby, but this is my first time coding a CW3 map.

I am trying to take creeper from point A, and deliver it to point B (and C and D)

Here's my code:

  #Checking Creeper amount at location A
  60 27 getCreeper ->MyVariable
  #Removing Creeper at location A
  60 27 1 1 (<-MyVariable 1000000 mul) FALSE damageCreeper
  #Adding Creeper at location B, C, D
  101 87 (<-MyVariable 1000000 mul) addCreeper
  83 59 (<-MyVariable 1000000 mul) addCreeper
  13 69 (<-MyVariable 1000000 mul) addCreeper

Unfortunately, this does absolutely nothing, although it compiles fine . What's my error? I'm sure it's some silly syntax problem...

Just in case, I'd like to ask for verification that the coordinates are the numbers listed in the bottom right of the edit window (e.g. M:60,27).

planetfall

Remove the parentheses. Those will move whatever is inside them. So a b (c d) will compile as a c d b.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Grayzzur

2nd problem is only DamageCreeper uses the "raw" creeper values requiring you to multiply by 1000000. The AddCreeper command should look more like "101 87 <-MyVariable AddCreeper"
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

stewbasic

Quote from: Grayzzur on June 02, 2014, 05:39:24 PM
2nd problem is only DamageCreeper uses the "raw" creeper values requiring you to multiply by 1000000. The AddCreeper command should look more like "101 87 <-MyVariable AddCreeper"
Moreover using SetCreeper would probably be simpler than DamageCreeper here, ie
60 27 0 SetCreeper

Coin_Star2

#4
Well, this is embarrassing... I did everything you suggested, but it still didn't work. Then I realized that I hadn't linked it with a CRPLCore... It worked fine after that.

Nonetheless, thanks for your help.

Just so I don't have to ask these simple questions again, is there a place were correct syntax for each command is explained in-depth? The wiki wasn't all too helpful, as it didn't have many examples.

Edit: Why is my Core able to be destroyed by a nullifier? Can I make so it is invisible and indestructible?

SuperDan

#5
Quote from: Coin_Star2 on June 03, 2014, 06:54:42 AM
Well, this is embarrassing... I did everything you suggested, but it still didn't work. Then I realized that I hadn't linked it with a CRPLCore... It worked fine after that.

Nonetheless, thanks for your help.

Just so I don't have to ask these simple questions again, is there a place were correct syntax for each command is explained in-depth? The wiki wasn't all too helpful, as it didn't have many examples.

Edit: Why is my Core able to be destroyed by a nullifier? Can I make so it is invisible and indestructible?
I use http://knucklecracker.com/wiki/doku.php?id=crpl:crplreference as a reference- the examples help a lot.
For your nullifier problem, you can either set it in the CRPL Core unit GUI thing or put this code in a once section:Self CONST_ISNULLIFIABLE 0 SetUnitAttribute You can find a list of constants here: http://knucklecracker.com/wiki/doku.php?id=crpl:docs:getunitattribute#unit_constants

Relli

Quote from: SuperDan on June 03, 2014, 07:51:07 AM
Self CONST_ISNULLIFIABLE 0 SetUnitAttribute
That ^
should be this
Self CONST_NULLIFIERDAMAGES 0 SetUnitAttribute

You can also make the unit invisible by changing the Alpha value using SetImageColor
http://knucklecracker.com/wiki/doku.php?id=crpl:docs:setimagecolor

Grayzzur

Quote from: Relli on June 03, 2014, 08:59:50 AM
You can also make the unit invisible by changing the Alpha value using SetImageColor
http://knucklecracker.com/wiki/doku.php?id=crpl:docs:setimagecolor
I prefer to just set the MAIN image to NONE, unless I intend to show/hide it repeatedly through the course of the map.
self "main" "NONE" SetImage
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

planetfall

Or just set the image and nullifiability in the editor window...
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

FishintehPond

Uhhh, how hard is a slip-emitter to add in?

Relli

Quote from: FishintehPond on June 03, 2014, 08:57:44 PM
Uhhh, how hard is a slip-emitter to add in?
A quick look at the editor shows no easy way to just place one down.
A quick look in my brain says there might be a way to CRPL yourself up one fairly easy (if you know CRPL in the first place)
I don't mind making this a project if you want it done. Assuming of course that there's no easier way already out there that I don't know of.

Michionlion

Just look at some save-games from the missions in the main campaign that have slip-emitters.
"Remember kids, the only difference between science and messing around is writing it down."
                                                                                                                         - Adam Savage

My website
My CW1, and CW2 maps!