Jump to content
aidenpons

(Discussion) What would be a perfect slug script?

Recommended Posts

aidenpons

As my NPL knowledge has grown I can do almost anything when it comes to slug scripts. DDI's scripts were absolutely atrocious, sending infinite quantities of slugs: kill one and another would rise to take its place. This meant you had Action Stations permanently on and a couple of RRs at all times ferrying crystals to the nearest Recharge Seam: essentially once you had reached that stage you just left it to your RRs to do something.

It also meant that when monsters appeared far away, all your Action Stations RRs would run back and forth between the monster and the slug, which is really annoying. So essentially slugs become a useless nuisance.

 

I can do much more than that. I can actually tie slugs to monsters emerging. I can spit out a fixed horde of 100 slugs and let you deal with that. I can tie the magnitude of invasions to your number of Support Stations. I can make invasions occur when you enter caverns. I can... well, the research is only just beginning.

 

But I cannot force certain slug holes to generate slugs or not. Using abuse of erosion I can get rid of slug holes (knock down a solid rock wall with a lava tile behind that erodes the slug hole. Paving over slug holes doesn't actually stop slugs from coming out.

 

What would your ideal slug script do?

 

Here are some of my ideas:

 

- Come in droves at once, not slug by slug

- Have periods of calm between them

- The more buildings you have, the more slugs you'll attract

- Paving over slug holes lowers the slug rate: pave over all holes to stop slugs from spawning

 

 

What are your ideas?

Share this post


Link to post
Share on other sites
Cyrem

Hmm I've have to think.

You have ' Come in droves at once ' and ' Have periods of calm between them ', can you combine those to have Waves? Increasing in difficulty obviously.

Share this post


Link to post
Share on other sites
aidenpons
1 minute ago, Cyrem said:

You have ' Come in droves at once ' and ' Have periods of calm between them ', can you combine those to have Waves? Increasing in difficulty obviously.

Of course! Using a loop I can generate a number of slugs equal to a register. I can make that register equal to anything. Here's some example code which should do the trick (haven't tested). Every 2 minutes, it spawns one more slug than it spawned last time.


 

Spoiler

 

 

; R1 is set to 0 at level start

; R1 = number of slugs
; R2 = number of times 30s have passed (as for all intents and purposes timers will not go higher than ~32000 -> 32s, as they're in milliseconds


GetTimer1 > 30000 ? :ThirtySecondsHavePassed

GetR2 > 3 ? :Invasion
; This triggers when R2 = 4, so 4 lots of 30s --> 2 min.

Stop

ThirtySecondsHavePassed:
TRUE ? SetTimer1 0
TRUE ? AddR2 1
; reset the timer and add 1 to "How many times have we passed thirty seconds?
; oh, and timers are in-game time, not real time (there are ways to measure real time in a script, if you're interested!)
; so speeding the game up speeds the timers up
Stop

Invasion:

TRUE ? AddR1 1
; Add 1 to our Total Slug Count to spam
; there are a variety of ways to get the game to send out R1 slugs, here's one of them:


Loop:
GetSlugsOnLevel > GetR1 ? :OutOfLoop
TRUE ? GenerateSlug
TRUE ? :Loop
; that's a nice loop to create R1 slugs

OutOfLoop:
TRUE ? SetR2 0
TRUE ? SetTimer1 0

 

 

 

The disadvantage of such a script is that if you leave it endlessly you will end up with 999 or more slugs on the map, which isn't ideal :P I was considering the trigger for an invasion would be when you teleport down anything (raider/building/vehicle): each time you do so it sends slugs equal to the number of stuff you've got. I'd accomplish this using something along the lines of:
 

Spoiler

 

 


; R1 = number of things on map, each frame
; R2 = number of things on map, last time we checked

TRUE ? SetR1 0

TRUE ? AddR1 GetToolStoresBuilt
TRUE ? AddR1 GetPowerStationsBuilt
; and so on through all the buildings...

TRUE ? AddR1 GetMinifiguresOnLevel

; not all vehicle commands are here but I know at least some of them are
TRUE ? AddR1 GetSmallDiggersOnLevel
; etc for the remaining ones...

GetR1 > GetR2 ? :InvasionTime

Stop


InvasionTime:
TRUE ? SetR2 GetR1

Loop:
TRUE ? GenerateSlug
GetSlugsOnLevel < GetR1 ? :Loop
; That's another way of doing a loop. There are loads... 

Stop
; that Stop really isn't neccessary

 

 

Untested and incomplete, but the idea is there.

 

 

 

N.B. If you are using a loop and the exit condition fails for whatever reason (eg there are no slug holes on the map thus GenerateSlug does nothing), keeping the scripter stuck in the loop, the game freezes up. Be careful!

Share this post


Link to post
Share on other sites
Cirevam

Waves of slugs + granting crystals and ore via NERPS + clever map design + inert wall buildings = tower defense

 

Survive X waves to win. Upgrade your towers to become more powerful (we can change weapon types and add a second laser independently, along with effects to show level). It would be quite problematic since there are no AI combat buildings, but maybe it could be done.

Share this post


Link to post
Share on other sites
aidenpons
18 hours ago, Cirevam said:

Waves of slugs + granting crystals and ore via NERPS + clever map design + inert wall buildings = tower defense

 

Survive X waves to win. Upgrade your towers to become more powerful (we can change weapon types and add a second laser independently, along with effects to show level). It would be quite problematic since there are no AI combat buildings, but maybe it could be done.

Island surrounded by water containing raider & Tool Store (to grab weapon) + high WeaponRange and travel speed (this is probably defined in the animations), or alternatively low BlockSize  = independent tower, perhaps? I'm not sure if LRRs will try and fire across water...

 

Is it possible to have a visual indicator of the reload time of manual-fire lasers?

 

Also, perhaps I can play around with SetCongretationAtTutorial to make manual paths of monsters... I've yet to play around with that function!

 

Also, see Whack-A-Slug for an example of what has been accomplished. This idea is definitely possible. I'm just not sure how annoying it'll be to play (hitting your own towers / Idleness Syndrome / Slugs immediately returning to their hole)...

Share this post


Link to post
Share on other sites
aidenpons

While there is no function GetElectricFences on level, there is GetPlaceFenceIconClicked. A little tweaking later, and I can make it so that whenever you click to place a new fence, you get the number of electric fences you've placed coming up at you:

GetPlaceFenceIconClicked > GetR2 ? :Sluggies



TRUE ? Stop

Sluggies:
TRUE ? SetR2 GetPlaceFenceIconClicked 
MakeASlug: 
TRUE ? GenerateSlug 
GetSlugsOnLevel < GetR2 ? :MakeASlug

All registers and timers are set to 0 on level start, so GetR2 is 0.

 

I should explain what the GetBlahBlahIconClicked button does: it returns the number of times you've clicked that button. Normally in the tutorials only one is needed (eg GetPusherIconClicked or GetDynamiteIconClicked). If you want to reset these numbers, that's what SetDynamiteIconClicked and other stuff like that is for.

 

So when you click to place a fence (even if the fence cannot be placed, and you're clicking the dulled-out grey square), 1 is bigger than 0, so it goes to Sluggies, where it updates R2 to the number of fence icons clicked and then starts generating slugs to that level (the next three lines are a reasonably painful loop to generate R2 slugs: there are many other ways of doing it).

 

Tada: so if you want to spam fences like you do in Rocky Horror, you will have a horde of slugs to deal with.

Share this post


Link to post
Share on other sites
aidenpons

Much thought later, I've put this together. It's basically a three part process.

 

1. A trigger occurs. There should be lots of triggers. Opening caverns (via GetTutorialBlockIsGround). Fences (GetElectricFenceIconClicked).  A new raider is teleported down. (GetMinifiguresOnLevel). Crystal count reaches a threshold (GetCrystalsCurrentlyStored). Building a new Support Station.  Teleporting in a vehicle. Monster emerges. First Power Station built. (Heheheh.... sending slugs at you when you're trying to get a Support Station up. I like this idea :smug:)

Crucially these triggers, while they can repeat, must not be infinite - unlike the Rock Hard slug script which essentially just needs random numbers to align, or the Back to Basics slug script which sends endless slugs at you.

 

2. Wait a random period of time. This prevents it from looking extremely scripted (compare Christchurch's lategame slug script, which blatantly spawns slugs every time you click the Place Electric Fence button).

There should also be the option for a trigger to occur and absolutely nothing to happen, so it doesn't happen every time.

 

3. Generate a number of slugs, where the number of slugs must scale with lategame. This could be done by the number of raiders on the level. Or related to the ore count. Or the crystal count. Or how much the player has drilled (this one requires tuto block shenanigans, but is definitely doable). Or just the nth time the slug script has run.

It must pick one of the above randomly so it doesn't just advance one slug each time (unlike the Back to Basics slug script).

3b. Instead of generating fifteen slugs immediately at once, generate them with teeny tiny delays in between. Maybe part 2 could have an 'advance scout' to let you know the slugs are coming.

 

 

Thoughts?

 

 

On the technical side, this is definitely doable. It'll require a register, a bunch of labels, and using obscure functions only used in tutorials, but it's utterly doable.

 

Maybe for part 1, I could implement a script whereby 'teleporting raiders attracts slugs;' hence to avoid the slugs, you want to teleport down as little as possible. That could combat the tendency to just spambuild everywhere - but at the same time, with enough determination & armed raiders you could definitely hold them off. Unless I make the number of slugs grow quicker than the number of raiders, which is definitely possible (a flat 2x multiplier would do it).

 

When thinking about Part 3, I'll have to keep in mind that slugs far away usually just return to their holes, so I'll need more slugs created for the more distant holes you've uncovered. After all, more holes should mean more slugs, right?

 

Also if I slugs have an OyxgenCoef this amount of slug spam will severely start to screw you over. I mean, you could build more Support Stations, but if every time you build a Support Station you get more than 10 slugs you're not exactly getting anywhere. :P

... Giving slugs an OxygenCoef also prevents abuse on the lines of:

- walling in slug holes to 'use slug spawn slots' (the only way to win most of Baz's levels...)

- just teleporting up your Tool Store and ignoring the slugs

 

.... Have I just made LRR difficultO.O

 

@Slimy Slug, as a denizen of Planet U, what do you think about being summoned from your hole in a manner like this? :P

Share this post


Link to post
Share on other sites
Slimy Slug

I very much approve of being summoned in this manner :P 

 

In all seriousness Lava Laughter actually takes advantage of one of your ideas above (assuming you put slug holes back): if you spam Raiders into the map, slugs will appear.  If you don't spam Raiders but reach a certain crystal goal, you start seeing a few slugs.  But if you spam Raiders AND reach the crystal goal?  They emerge in force.  

 

What's even better is the script has a check to prevent the slug script from going out of control.  If the number of slugs exceeds five, then it forces it to skip them until the number drops back down.  Question remains why did they take the slug holes out/presumably edit the map further.

 

Either way, these are great slug script ideas you've put forward!

Let me know when you want me to go feast on those crystals and I'll be out of my hole in a hurry :tf:

Share this post


Link to post
Share on other sites
berylliumquestion

The perfect slug script is one where like a hundred of slug combine into one giant, like the size of the rock whale except bigger, slug that can eat buildings. :^) Don't let too many slugs get out or you'll have a really big problem!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.