Jump to content

Npl Script Help With Slugs.


fun
 Share

Recommended Posts

Please Help :cry: i know i am not doing any thing wrong but i have some problems as you see i am redoing The # 7 tutorial and this is the NPL script for it

TRUE ? SetR1 0

TRUE ? SetR2 0

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted

GetOxygenLevel < 30 ? :skip

GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetSlugsOnLevel > GetR2 ? :skip

loopstart:

GetR2 = 0 ? :loopend

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

TRUE ? :loopstart

loopend:

Stop:

and The LEGO Cfg status


Tutorial07

  {

   FullName	  Slug_fun!

	  AllowRename	  TRUE

   RecallOLObjects	 TRUE

   GenerateSpiders	 TRUE

   ; Amount of time before an emerge trigger can be reused.  1500 specifies 1 minute.

   EmergeTimeOut	2500.0

   BoulderAnimation Rock


   BlockSize	  40

   DigDepth	  40

   RoughLevel	  6

   RoofHeight	  40

   UseRoof	   YES

   SelBoxHeight	 10

   FogColourRGB	 149:29:1  ;Lava Fog

   HighFogColourRGB	190:60:0  ;Lava Fog

   SurfaceMap	  Levels\GameLevels\DigTuto_03\High_D03.map

   PredugMap	  Levels\GameLevels\DigTuto_03\Dugg_D03.map

   TerrainMap	  Levels\GameLevels\DigTuto_03\Surf_D03.map


   CryOreMap	  Levels\GameLevels\DigTuto_03\Cror_D03.map



   TextureSet	  Textures::Rock

   RockFallStyle	 Rock

   EmergeCreature	 RockMonster

   SafeCaverns	  TRUE

   OListFile	  Levels\GameLevels\DigTuto_03\D03.ol

   PTLFile	   Levels\GameLevels\DigTuto_03\D03.ptl

   NERPFile	  Levels\GameLevels\DigTuto_03\D03.npl

   NERPMessageFile	 Levels\GameLevels\DigTuto_03\D03.txt

   ObjectiveText	 Languages\ObjectiveText.txt

   ObjectiveImage640x480   Interface\BriefingPanel\BriefingPanel.bmp,76,100

   NextLevel	  Levels::Tutorial08

   LevelLinks	  Levels::Tutorial08

   FrontEndX	  123

   FrontEndY	  307

   ;FrontEndOpen	 TRUE

   MenuBMP	   Levels\GameLevels\Tutorial07.bmp,Levels\GameLevels\GTutorial07.bmp,Levels\GameLevels\Tutorial07G.bmp

   Priorities {

	AI_Priority_Train	 TRUE

	AI_Priority_GetIn	 TRUE

	AI_Priority_Crystal	 TRUE

	AI_Priority_Ore	  TRUE

	AI_Priority_Repair	 TRUE

	AI_Priority_Clearing	TRUE

	AI_Priority_Destruction	TRUE

	AI_Priority_Construction   TRUE

	AI_Priority_Reinforce	TRUE

	AI_Priority_Recharge	TRUE

   }


	Reward {

	Enable		TRUE

	Modifier	   2

	Importance {

	 Crystals	   250

	 Timer		20

	 Oxygen	   10

	 Caverns	   20

	}

	Quota {

	 Crystals	   140

	 Timer		900

	 Caverns		17

	}

   }								  

  }

but this is the problem when making my slug set up based on energy crystals collected like the goal is 140 in this case

so i should get some slugs when at 16 Energy crystals but i am not as seen here LegoRR2011-10-1115-48-25-22.jpg

Currently i should have at least 4 slugs tackling the area now but no nothing is happening

Even worse the level dose not complete at 140 Energy Crystals as seen here oh i used the debug keys to debug pass it so do not get confused thanks :)LegoRR2011-10-1116-34-44-31.jpg and the scrip is right and i saved with the file name this what named it D03 .npl so any help would be nice.

Link to comment
Share on other sites

Did you compile it with either Cyrem's NPL Scripter, or any of the other tools available?

If you did, check that the compiled .npl scripts filesize is more than 0, else you've encountered an error you need to fix.

Link to comment
Share on other sites

Did you compile it with either Cyrem's NPL Scripter, or any of the other tools available? If you did, check that the compiled .npl scripts filesize is more than 0, else you've encountered an error you need to fix.

Why yes i did with Cyrem's NPL tool to be exact and yes i did check my NPL file and it is 0 so that must be the problem oh i have a question how dose a NPL file have to be in size :puzzled:

Link to comment
Share on other sites

oh i have a question how dose a NPL file have to be in size :puzzled:

Anything above 0.

Here's your script:


TRUE ? SetR1 0

TRUE ? SetR2 0

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted

GetOxygenLevel < 30 ? :skip

GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetSlugsOnLevel > GetR2 ? :skip


loopstart:

GetR2 = 0 ? :loopend

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

TRUE ? :loopstart

loopend:

Stop:

Let's analyse.

TRUE ? SetR1 0

TRUE ? SetR2 0

You've declared that these two variables should equal zero, because you want to use them in the script. That's fine.

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted

GetOxygenLevel < 30 ? :skip

EXPLOSION! There first 5 lines are correct. How ever, on line 6, you've placed a ":skip" function start. Now, this would be fine if you had a function "skip" to goto, and you weren't declaring it start there. Remove ":skip" and replace it with something useful.

GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetSlugsOnLevel > GetR2 ? :skip

WOAH, WOAH. Everything but the last line is fine. However, that last line you've done goof'd in the exact same way as last time. Since, without the ":skip" bit, this line is redundant, destroy it, unless you want to spawn more slugs, by which you would replace ":skip" with some slug spawn code.

loopstart:

GetR2 = 0 ? :loopend

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

TRUE ? :loopstart

loopend:

Stop:

HEY, HEY, HEY. You've got two "loop" sections in the wrong order. To start a function, you need to have the colon (:) first, then the name of the function. Next, you need to have everything ordered. "loopstart" and "loopend" are seperate functions to LegoRR, so make sure you change this. Lastly, get rid of the "Stop:" code. There is no other reference to "stop" in the code, so this is redundant. The following code should work:

TRUE ? SetR1 0

TRUE ? SetR2 0

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted


GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

Link to comment
Share on other sites

oh i have a question how dose a NPL file have to be in size :puzzled:

Anything above 0.

Here's your script:


TRUE ? SetR1 0

TRUE ? SetR2 0

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted

GetOxygenLevel < 30 ? :skip

GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetSlugsOnLevel > GetR2 ? :skip


loopstart:

GetR2 = 0 ? :loopend

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

TRUE ? :loopstart

loopend:

Stop:

Let's analyse.

TRUE ? SetR1 0

TRUE ? SetR2 0

You've declared that these two variables should equal zero, because you want to use them in the script. That's fine.

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted

GetOxygenLevel < 30 ? :skip

EXPLOSION! There first 5 lines are correct. How ever, on line 6, you've placed a ":skip" function start. Now, this would be fine if you had a function "skip" to goto, and you weren't declaring it start there. Remove ":skip" and replace it with something useful.

GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetSlugsOnLevel > GetR2 ? :skip

WOAH, WOAH. Everything but the last line is fine. However, that last line you've done goof'd in the exact same way as last time. Since, without the ":skip" bit, this line is redundant, destroy it, unless you want to spawn more slugs, by which you would replace ":skip" with some slug spawn code.

loopstart:

GetR2 = 0 ? :loopend

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

TRUE ? :loopstart

loopend:

Stop:

HEY, HEY, HEY. You've got two "loop" sections in the wrong order. To start a function, you need to have the colon (:) first, then the name of the function. Next, you need to have everything ordered. "loopstart" and "loopend" are seperate functions to LegoRR, so make sure you change this. Lastly, get rid of the "Stop:" code. There is no other reference to "stop" in the code, so this is redundant. The following code should work:

TRUE ? SetR1 0

TRUE ? SetR2 0

GetToolStoresBuilt = 0 ? AddR1 1

GetMiniFiguresOnLevel = 0 ? AddR1 1

GetR1 = 2 ? SetLevelFail

GetOxygenLevel = 0 ? SetLevelFail

GetCrystalsCurrentlyStored > 139 ? SetLevelCompleted


GetCrystalsCurrentlyStored > 15 ? SetR2 1

GetCrystalsCurrentlyStored > 25 ? SetR2 2

GetCrystalsCurrentlyStored > 40 ? SetR2 3

GetCrystalsCurrentlyStored > 55 ? SetR2 4

GetCrystalsCurrentlyStored > 65 ? SetR2 5

GetCrystalsCurrentlyStored > 80 ? SetR2 6

GetCrystalsCurrentlyStored > 99 ? SetR2 7

GetCrystalsCurrentlyStored > 114 ? SetR2 8

GetCrystalsCurrentlyStored > 130 ? SetR2 9

GetCrystalsCurrentlyStored > 135 ? SetR2 10

GetCrystalsCurrentlyStored > 138 ? SetR2 11

GetRandom100 < 10 ? GenerateSlug

TRUE ? SubR2 1

Thank you so much now this should be a be a big help Chears Mate :af::) :D

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.