Problem with example code?

Started by milkev, April 03, 2016, 06:16:41 PM

Previous topic - Next topic

milkev

hello, I tried to use the example code at this link: https://knucklecracker.com/wiki/doku.php?id=crpl:docs:settechlimit

The only thing a changed about the code was line 12 of the code (the line were it added the techlimit) to this:

  <-type dup GetTechLimit 1 add SetTechLimit


of course, i set the variable before hand using:

$type:"firerange"

this immediately just went into orbit and upped my tech limit.


offside note to a previous post: If it didn't make this code, then what auto sets the code area, and if it doesn't auto-do it then how do i do it.
off side offside note: how would i make a spoiler?

GoodMorning

Last to first:

Spoilers can be created using:
[spoiler][/spoiler]
This is what the "radiation warning" symbol button in the editing panel refers to.

Code is not bracketed automatically. Use these tags:
[code][/code]

There are issues with trying to put string values in the $variable:value initialisation.

Also, be sure about the capitalisation of built-in constants. I don't think it's a problem here, but...
A narrative is a lightly-marked path to another reality.

milkev

I have the type set as capitals in the crpl setup (were i choose the variables specific to that crpl core) but i dont think the problem is the variable, i think its the if statement. it seems right to me...

Builder17

Check , that max ammo in CRPL core isn't 0 , when you add this script into it , not sure if it's because it.  ???
You have to change max ammo from crpl core settings menu to over 0 , default is 0.

milkev

#4
Quote from: Builder17 on April 04, 2016, 02:05:23 PM
Check , that max ammo in CRPL core isn't 0 , when you add this script into it , not sure if it's because it.  ???
You have to change max ammo from crpl core settings menu to over 0 , default is 0.

i thought the command sets that max ammo? in :awake? or does it need to be done in the options? will try setting it in options but its always set my default max ammo to 25, soo.....

edit: it does automatically set the max ammo to 25 for me (im not using steam, if it does that on steam idk) anyway, i set the options so that it cant be destroyed by nullifier, doesnt count for victory, doenst leave a pz and set the ac ammo to 25, it works now but... idk why it didnt before 0.o

GoodMorning

The command in :awake will set the maximum ammo, and will do so when the script is run.
A narrative is a lightly-marked path to another reality.

milkev

Quote from: GoodMorning on April 04, 2016, 07:32:12 PM
The command in :awake will set the maximum ammo, and will do so when the script is run.

ok, so as long as the script is running it will set the max ammo and all the other stats repeatedly until it gets destroyed? i thought thats what happened normally 0.o

GoodMorning

:awake runs on load or creation, so that you can set fields etc. The use here will not break anything, however.
A narrative is a lightly-marked path to another reality.