Jump to content

Vehicle Script


Yourself
 Share

Recommended Posts

Hello folks,

I've made a custom map that is almost done, I just need to get the scripting right. I want the player to win once they have returned a certain Hover Scout (present at the start of the level) to a certain area, and to lose if that Hover Scout gets destroyed. (Similarly to the Explosive Action level, in which you need to recover a small digger). I've looked on the forums and in Explosive Action's script files, but I can't really figure out how to do it. Does anyone have experience with this?

Link to comment
Share on other sites

i know that you can add the vechicle bye adding it in the object list ... but i dont know anything about the level win triggers , so sorry ... i can't help ya

Link to comment
Share on other sites

You need to write and compile an .npl file for this. I think there's an npl compiler in the downloads section.

I don't know how to write npls, so you have to ask someone else or look up a tutorial.

Link to comment
Share on other sites

Alright buddy, I have good news and bad news.

Good news is that it's not that hard to create some scripts once you get used to it. Simply head over to the downloads section and get Cyrem's NPL Scripter. From there, you can search up on the wiki, and the .nrn and .nrm files in your LegoRR level folders, for tutorials and references.

Bad news is this; LegoRR doesn't have any specific scripting functions for specific units. You'll need to mutilate your objectivies.

How about this? You need to find a hidden hover scout and a Rock Raider (the only specific unit function avaliable) and then get to another area on the map? Note that when I say get to another area on the map, what actually happens is that any of your Rock Raiders or Vehicles who walk/drive/sail over a specific block on the map will succed the mission; you can't make it so only the Hover Scout will trigger the end.

Link to comment
Share on other sites

Bad news is this; LegoRR doesn't have any specific scripting functions for specific units. You'll need to mutilate your objectivies.
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA

Honestly, have you even played Explosive Action?

(but, I will say, the Hover Scout has no NPL code, and I'm really not sure how it all works. It might not work for custom vehicles.)

Link to comment
Share on other sites

Honestly, have you even played Explosive Action?

Well, duh.

Fine then, you make a script for it. This ought to be interesting.

Link to comment
Share on other sites

Honestly, have you even played Explosive Action?

Well, duh.

Fine then, you make a script for it. This ought to be interesting.

?

Don't do that. I'd like to see you give this gentleman a script which does exactly as he has asked, with no work-arounds or changes.

Link to comment
Share on other sites

Honestly, have you even played Explosive Action?

Well, duh.

Fine then, you make a script for it. This ought to be interesting.

?

Don't do that. I'd like to see you give this gentleman a script which does exactly as he has asked, with no work-arounds or changes.

Ask Mouse, he's much better at making scripts than I. I don't have time either (well I do but I'm lazy).

And I'm going to ignore the work-around part as I stated why there has to be in an earlier post. As in, ten minutes ago ;P

Link to comment
Share on other sites

Thanks everyone. I'll probably wait for Mouse to reply to this topic, then.

(but, I will say, the Hover Scout has no NPL code, and I'm really not sure how it all works. It might not work for custom vehicles.)

If you're saying that a script like in Explosive Action would only work with a Small Digger, then that's OK, it wouldn't ruin the level to replace the Hover Scout with a digger.

Link to comment
Share on other sites

  • 1 month later...

No, it it certainly possible to write a script that does what you want. I'm not the man for it, never really figured out the scripting stuff. But you would need a tutorialblock marked in the map editor and the scout would have to be made into a recordobject somehow. Exactly how that is done I do not know.

Link to comment
Share on other sites

Explosive Action has a really wacky NPL. Here's an excerpt from an NPL that addict recently wrote for me that checks to see if a Small Digger has reached a designated spot and fails if either the digger or the Tool Store is destroyed. I've added a few comments that explain what I think some of the lines do:


TRUE ? SetR1 0
GetToolstoresBuilt = 0 ? AddR1 1
GetTutorialBlockIsGround 5 = FALSE ? :SkipDiggercheck ; The digger is placed on the Tuto5 block in the OL. This is how we designate what object triggers victory.
GetSmallDiggersOnLevel = 0 ? AddR1 1 ; If no visible diggers exist, add 1 to the R1 register.
SkipDiggercheck:
GetR1 > 0 ? SetLevelFail

GetUnitAtBlock 1 ? :Message1
GetUnitAtBlock 2 ? :Message2
GetRecordObjectAmountAtTutorial 4 > 0 ? SetLevelCompleted ; If the object that was designated by GetTutorialBlockIsGround is on the Tuto4 block, victory.

Stop
;check for level fail

You should direct any questions towards addict since he knows how to write this type of mission now.

Link to comment
Share on other sites

GetTutorialBlockIsGround 5 = FALSE ? :SkipDiggercheck ; The digger is placed on the Tuto5 block in the OL. This is how we designate what object triggers victory.

Nonono. This checks if the cavern has been revealed yet so that the GetSmallDiggersOnLevel function doesn't ignore the digger (see, that function ignores entities in hidden caverns).

GetRecordObjectAmountAtTutorial 4 > 0 ? SetLevelCompleted ; If the object that was designated by GetTutorialBlockIsGround is on the Tuto4 block, victory.

Nonono. The object is designated by "TRUE ? GetRecordObjectAtTutorial 5" (not visible in this excerpt.)

Link to comment
Share on other sites

You know addict, you could just take that script and modify it to meet the OP's needs (and perhaps add comments around the various functions). It would be very educational for the rest of us who don't know what we're talking about. :x

Link to comment
Share on other sites

You know addict, you could just take that script and modify it to meet the OP's needs (and perhaps add comments around the various functions). It would be very educational for the rest of us who don't know what we're talking about. :x

But how's the OP gonna learn from that?

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.