Inventory bug or am i doing something wrong?

So i made this command that basically goes like
"Take X"
If it's the first time:
Adds X to inventory and prompts "I took X"
else
It prompts "I already have all the X i need!"

Thing is, after that, if i input "Inventory" it says "You arent carrying anything"

Is it a bug or am i doing something wrong?

(I know Quest has a built-in "Take" command, but the game im working on is in spanish, problem is the spanish word it uses has a whole different meaning in Argentinian spanish, maybe there's a way to replace that word?)


hmm... there's a lot of built-in underneath coding for the 'take' feature/ability ...

I'm going to guess that it has to do with this:

the conceptual inventory is just the 'player' Player Object: any Object contained within the 'player' Object is in the 'inventory'

but, there's also likely a hidden 'inventory' Objectlist Attribute, and so, since you've only put/moved/set the Object inside of the 'player' Object, it's probably using the 'inventory' Objectlist Attribute to check for what items/Objects you got (but there's been no updating of it and/or you've not added your Object name to this 'inventory' Objectlist Attribute), when you do the 'inventory' command, and thus it says you don't have anything in the 'inventory'.

Also... make sure to check that it's successfully moving your Object into your 'player' Player Object, as it might not even be doing this... and if it's not, then that would also possibly be why the 'inventory' command is saying you got nothing in it too...

you can do this check this way (after you've done the moving Script/Function/command of course):

msg ("The location of your Object is: " + NAME_OF_YOUR_OBJECT.parent)

// if it says 'player' (or whatever you renamed the 'player' Player Object as, meh), then you're good with this (we narrowed down the issue): something else is causing the 'inventory' command to say you got nothing.

// if it doesn't... we need to get this working... and even then... you may still have the 'inventory' command saying you got nothing...


either, try to work with the built-in 'take' feature/ability (don't over-ride/over-write it!), or you got to figure out how it works (if my guessing on how it works above, is wrong, which could be likely, lol) and do all the things you need to do for it to work.


or...

you can modify the 'take' (but this will be universal if you modify it's code/scripting of it - 'take' is a built-in 'Command' Element along with also being a built-in 'Verb' Element too - 'Verbs' actually are a 'Command', unless you only modify it for a specific Object):

globally/unversally change take:

in the bottom left corner is: filter -> show library elements -> (toggle this on) -> then above in the left side's 'tree of stuff', you'll now see light grey text, this is all of the built-in stuff, which you can then modify (via doing this through the GUI/Editor, it forces you to copy, so you're not messing up the actual quest files)

locally (specific Object) change take:

(I'm not familiar with the GUI/Editor... and am too lazy/tired to open it up to see how this is done exactly)


or... maybe you can do something like this:

<command name="custom_take_command">
  <pattern>custom_take #object_parameter#</pattern> // there might be parsing issues (it might try to do the built-in 'take' Command instead of our (custom) 'custom_take_command' Command ... so I put in an underscore to be safe
  <script>
    firsttime {
      do (object_parameter, "take") // make sure your Objects have the 'take' Verb toggled on for them if doing with the GUI/Editor or do the same in-code
      msg ("I took " + object_parameter.name)
    } otherwise {
      msg ("I already have all the " + object_paramter.name + " I need!")
    }
  </script>
</command>

let me know if none of this works and/or if you need help with any of it (if you're getting errors or whatever problems with it)


P.S.

you can also copy the 'take' Command's scripting and paste it into a new Command, study how it works, and modify it to doing what you want, while leaving in all the rest that is needed, so that the 'inventory' command will work correctly.


If you are using the desktop version, you can modify the language file. You will probably find them here:
C:\Program Files (x86)\Quest 5\Core\Languages

Copy the spanish.aslx file to your game folder, and open it in a text editor, such as Notepad. There is some help on what you need to do here, but I guess most of it is already done:
http://docs.textadventures.co.uk/quest/translating_quest.html

Give the file a new name, argentinian_spanish.aslx. Then open your game withthe text editor, and on around the third line you will see a reference to the spanish file. Change that to argentinian_spanish.aslx, and it will use your modified version instead.

Give a shout if you need more detail.

If you are using the web version, that is not an option. Despite what hegemonkhan says, there is no objectlist attribute, so that is not the issue. Exactl;y how is your command set up? What is the pattern? If you click on Code view, could you copy and paste the code into a post?


Can also just use the script "add to inventory" to add the object to your inventory. That I'd say is the simplest option available.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums