Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Clean0nion on October 30, 2013, 06:25:16 PM

Title: A really stupid question
Post by: 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?
Title: Re: A really stupid question
Post by: Lost in Nowhere on October 30, 2013, 06:30:33 PM
Have you pushed "edit"?
Title: Re: A really stupid question
Post by: teknotiss on October 30, 2013, 06:33:08 PM
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)
Title: Re: A really stupid question
Post by: 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.
Title: Re: A really stupid question
Post by: teknotiss on October 30, 2013, 06:36:37 PM
no worries dude! :)
Title: Re: A really stupid question
Post by: 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..
Title: Re: A really stupid question
Post by: Clean0nion on November 02, 2013, 06:34:39 PM
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.
Title: Re: A really stupid question
Post by: 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?
Title: Re: A really stupid question
Post by: Karsten75 on February 02, 2015, 10:29:17 PM
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.)
Title: Re: A really stupid question
Post by: pastor.healer on February 02, 2015, 10:40:50 PM
That helps.  Thanks!
Title: Re: A really stupid question
Post by: Karsten75 on February 02, 2015, 10:47:31 PM
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.