A really stupid question

Started by Clean0nion, October 30, 2013, 06:25:16 PM

Previous topic - Next topic

Clean0nion

How do I get CRPL in my maps?

I'm hitting the 'Scripts' button in the Unit section of the editor, but any script I put in there and hit'Create' doesn't seem to be doing anything. Hitting 'Compile' retruns 0 Scripts Successfully compiled into 0 opcodes.

I'm trying to do this script: if (<-fire)
   @GetUnitTypeCount("REACTOR") ->reactorCount
   #Do something based on reactorCount
endif

:GetUnitTypeCount
->unitType
0 ->count
do (GetUnitsInRange(0 0 9999) 0)
->unitUID
if (GetUnitType(<-unitUID) eq(<-unitType))
<-count add(1) ->count
endif
loop
<-count


Can anyone help me with getting any CRPL in my map?

Lost in Nowhere

Don't die! :)

teknotiss

Quote from: Clean0nion on October 30, 2013, 06:25:16 PM
How do I get CRPL in my maps?

I'm hitting the 'Scripts' button in the Unit section of the editor, but any script I put in there and hit'Create' doesn't seem to be doing anything. Hitting 'Compile' retruns 0 Scripts Successfully compiled into 0 opcodes.

I'm trying to do this script: if (<-fire)
   @GetUnitTypeCount("REACTOR") ->reactorCount
   #Do something based on reactorCount
endif

:GetUnitTypeCount
->unitType
0 ->count
do (GetUnitsInRange(0 0 9999) 0)
->unitUID
if (GetUnitType(<-unitUID) eq(<-unitType))
<-count add(1) ->count
endif
loop
<-count


Can anyone help me with getting any CRPL in my map?

ok,
click scripts button
name your script and click create,
a notepad or notepad++ window should open,
edit that txt with the script you want,
save it.
then click compile and you should be onto a winner  8)
"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

Clean0nion

Quote from: teknotiss on October 30, 2013, 06:33:08 PM
ok,
click scripts button
name your script and click create,
a notepad or notepad++ window should open,
edit that txt with the script you want,
save it.
then click compile and you should be onto a winner  8)

Wow thank you. I was pasting the code directly into the title bar. Thank you so much.

teknotiss

"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

Jacobkolstad

Quote from: Clean0nion on October 30, 2013, 06:35:09 PM
Quote from: teknotiss on October 30, 2013, 06:33:08 PM
ok,
click scripts button
name your script and click create,
a notepad or notepad++ window should open,
edit that txt with the script you want,
save it.
then click compile and you should be onto a winner  8)

Wow thank you. I was pasting the code directly into the title bar. Thank you so much.
Does it work now? If so, I have wasted 3 hours pointless trying to re-code ya project, but no problem actually..

Clean0nion

Quote from: Jacobkolstad on November 02, 2013, 04:30:33 PM
Quote from: Clean0nion on October 30, 2013, 06:35:09 PM
Quote from: teknotiss on October 30, 2013, 06:33:08 PM
ok,
click scripts button
name your script and click create,
a notepad or notepad++ window should open,
edit that txt with the script you want,
save it.
then click compile and you should be onto a winner  8)

Wow thank you. I was pasting the code directly into the title bar. Thank you so much.
Does it work now? If so, I have wasted 3 hours pointless trying to re-code ya project, but no problem actually..
No. Still doens't work.

pastor.healer

Does the Notepad file need to be set in a particular folder location to work?

Karsten75

#8
Quote from: pastor.healer on February 02, 2015, 10:12:48 PM
Does the Notepad file need to be set in a particular folder location to work?

Yes, it should save to the "scripts" folder within the Map directory structure.  If you can't find it, it's probably best to open the script from within the editor and then paste the CPRL from another map into that file. Then save it and it will be saved in the correct location. (Hope that makes sense.)

pastor.healer


Karsten75

Quote from: pastor.healer on February 02, 2015, 10:40:50 PM
That helps.  Thanks!

I really hope it does, that's where you seemed to be stuck last night. :)

I'll sit in chat for a few minutes in case you want to ask a quick question.