Author Topic: Creating a Skip Level Item  (Read 817 times)

WidgetKitty

  • Level 3: Plugger
  • *
  • Posts: 32
    • View Profile
    • My YouTube channel, where I'll be posting videos of my games
Creating a Skip Level Item
« on: October 22, 2022, 12:38:35 AM »
Hi guys - so I have this custom item I want to use. Basically it's the ability to bribe one of the big boss's henchmen to let you skip some of the levels:



You collect a lot of cash in my game, and there's these tank, train, and airship levels - three of each - that block your path but aren't part of the numbered levels, and tend to be harder. So I thought it'd be neat to be able to skip them for $500. Everything functions fine like I'd expect, except one issue: if you play the level legitimately, and then re-enter it, I want that item gone - and the NPC too, if I can.

I was looking for a command along the lines of "if course complete" but found nothing, and my experiments with that failed. The I thought I could have a variable made by a command just before the level exit, then added a command in the item's "create" area:

if game var skip = 1
{
remove item 46
}

Item 46 being that Skip Level for sale. This command did nothing, not sure if I used the right syntax. I also tried using that command in the individual item placed in the level (which I realized I might need to do anyway, since each skippable level would need its own variable). Anybody know how I can make this item and NPC disappear for replays after the level they're in is completed, whether the player played or paid?

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Creating a Skip Level Item
« Reply #1 on: October 22, 2022, 10:38:01 PM »
NPC's have special appearance settings. it goes something like.. always, until talk and until course complete. try changing that.

as for the item... your solution to add a conditional check is valid. I use a similar process. here's what I would do..
in the same prompt that's used to skip the level, write "game var skip=1". run this command near the end of your course as well, with an invisible <-> command block. just so you don't miss it.
I don't know why your item wasn't destroyed.. make sure to run the command when the item is in view. maybe try a different command? kill item, destroy item, delete item, clear item
by the way, your use of syntax is valid. {} are for conditionals and [] are for delay commands and reading variable value. although you don't need brackets for a singular command line.
« Last Edit: October 22, 2022, 10:40:15 PM by Gizgord »

WidgetKitty

  • Level 3: Plugger
  • *
  • Posts: 32
    • View Profile
    • My YouTube channel, where I'll be posting videos of my games
Re: Creating a Skip Level Item
« Reply #2 on: October 23, 2022, 07:51:41 AM »
NPC's have special appearance settings. it goes something like.. always, until talk and until course complete. try changing that.

as for the item... your solution to add a conditional check is valid. I use a similar process. here's what I would do..
in the same prompt that's used to skip the level, write "game var skip=1". run this command near the end of your course as well, with an invisible <-> command block. just so you don't miss it.
I don't know why your item wasn't destroyed.. make sure to run the command when the item is in view. maybe try a different command? kill item, destroy item, delete item, clear item
by the way, your use of syntax is valid. {} are for conditionals and [] are for delay commands and reading variable value. although you don't need brackets for a singular command line.

Ah OK, thanks - sounds pretty straight forward. I'll try this next time I work on the game