All numbers expression?

0 favourites
  • 8 posts
From the Asset Store
Add this awesome sound effects to make your visual novel come to life!
  • I'm using "List" as an inventory in my game. I want to make something like "if player has a pistol in his inventory, then quest starts". To make that I'm using "Compare item text at" in my event table, but it asks me for "Index" (where my pistol is based ny number in the list), player can find it in any moment in the game, not specific, so I want to make it read ALL numbers from zero to, for example, 99999, so wherever pistol is placed in a list, an event will occur. I can't find any expression that will read all the numbers. How to make it?

  • Why use the list object for this?

    If the quest starts when the pistol is added to the inventory it seems unnescessary..

  • Why use the list object for this?

    If the quest starts when the pistol is added to the inventory it seems unnescessary..

    I don't know how to use arrays and tutorials about array inventory are too complicated. List is much simplier and it's perfect for text games.

  • If it helps with Arrays, think of them as a room number in a hotel. "room 234" The first number is the floor your on, the second is the wing you are in, and the third is the room. Treat the array as 1 number and it's easier to grasp how it holds a value. Every combination holds it's own value.

    If you only use X & Y it gets simpler, you only have floor and room.

    (yes you can have more than a single digit in each, but it's a weird hotel.)

    LittleStain, I grasp what he means, if you pick up the banana, and you have a pistol in your inventory, the quest starts. Or you enter the forbidden zone, and you have the pistol...

    does this work?

    System | For "Search" from 1 to List.ItemCount|

    > List | Item loopindex text is "pistol" (ignore case) | System | Set CurrentQuest to "PistolQuest"

  • Wow, thanks! I'm gonna try this out in minutes!

  • It doesn't work

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It doesn't work

    You are only checking item 0

    if you check item loopindex it works..

    so you should replace the 0 in the list item compare condition with loopindex

  • Oh, it actually works! Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)