Really basic stuff. (probably)

sharky3008
16 May 2013, 10:39
I've only just started using quest and have no prior knowledge of programming whatsoever. Someone may have already covered this in the forum, but I can't find it if they have. I was wondering if someone could help me by explaining in plain English how I could make an object that isn't a container (bed) and have and item under it, (magazine) and also be able to put other things under it. I'd prefer to be able to do it using Quest rather than code please. I think if I knew these things then it would help me to understand a lot more about using Quest.

Liam315
16 May 2013, 12:56
A command like "look under" can be a bit tricky because the player is looking in a position relative to an object rather than at an actual object; "under bed" is not an actual object. There are a few ways you can go about this, I'll give you two (one very simple, one a bit more complex but more comprehensive). Someone else may have other suggestions also.

1) Create an object called "under bed" and use this to co-ordinate everything you want to to with it, you can make description's, make it a container etc. and it should work fine. The downside to that is that if the player ever tries to look under any other object (look under table etc.) they will get a response of "I can't see that (under table)."


2) A more elegant solution requires the creation of a new command and custom attribute. You would need to do the following:

- Add a new command, set pattern to "command pattern" and in the box below it copy and paste-
look under #object#;l under #object#; look underneath #object#; l underneath #object#

- Click add script and select the "if..." script. Leave it set to "expression" and in the box copy and paste-
HasAttribute(object, "under")

- In the "then" field, add the script called "run an object's script attribute." Select "expression" in the first box and type "object" in the field without the quotation marks. Leave the next box set to "name" and in the second field type "under", again without quotation marks.

- Click "add else" and select "print a message" as the script. I would change it to expression and use something like this:
"You see nothing extra that you wouldn't see examining " + object.article + " as a whole."
(Remember this need to be with the quotation marks.)

- Now for every object you want to be able to look under, all you need to do is go to the attributes tab, click "add attribute," select "script" as it's type and add in the script for what you want to do.

The upside to the second method is that you cover any objects you may want to look under in the future and prints a sensible response if the player tries to look under anything else. The downside is that the player can't use under the bed as a container and put things under there. There are more involved and complicated ways to get around that downside but one of these two should suit your needs, unless anyone else has a simpler solution that I've overlooked.

HegemonKhan
16 May 2013, 23:58
I had the same dilemna when I was starting out with quest too, with "cabinets~dressers~workdesks~bed", which I wanted to have it's inside be a (container) with stuff in it, and also use it's top as a (surface) for stuff to be put on top of it. This was way back when I didn't know any coding either, so I just ending up making two objects, one to act as the (container) and one to act as the (surface). Not the most preferred method, as you've got two objects, but meh, we've got imagination, laughs.

sharky3008
18 May 2013, 20:13
Thanks for your help Liam.

Just after posting on here I managed to work out how to 'look under" using a verb and managed to list what is under the bed. It works fine until I type "look under bed" after I have already removed the magazine, then it doesn't reply, I have put in a temporary fix for now but was wondering if you could have a look at the problem and maybe suggest how to remedy this. It's just that I want to put more than 1 object under some items and my temporary fix isn't up to par for that.

Sora574
18 May 2013, 21:11
Changelist:
[list][*]Added simple 'put under' command (feel free to change it to a verb or something)[/*:m]
[*]Switched the bed's 'contentsprefix' attribute to 'listchildrenprefix' (or something like that) so the ListObjectContents function will read it[/*:m]
[*]Changed the bed's script for 'look under'[/*:m][/list:u]
If you need me to explain any of it, just let me know.

EDIT: Changed the bed script again (Forgot there was a 'GetDirectChildren' function already)

sharky3008
20 May 2013, 08:59
Thanks Sora. That works great, easy to understand and alter for other things that I have in mind. :-)

sharky3008
28 May 2013, 21:55
I'm now trying to work with wearable items (understood most of it from Pixies library), Is there an easy way (preferably using Quest) to assign certain clothes to body parts (shoes to feet for example) and to limit the amount of items you can wear on that body part (1 pair at a time lol). At the moment my character can wear jeans, trousers, shirt, t-shirt, shoes, trainers and a hat all at once.I also noticed that if I try to drop the clothes that I'm wearing it still says (worn) after the clothing item. I don't know if you'll need to see what I have done to help me with this or not so haven't uploaded anything unless you want to see it.

HegemonKhan
29 May 2013, 02:28
Equipment Libraries:

Chase's Wearables Library: http://quest5.net/wiki/Clothing_Library2

Pixie's Clothing Library: viewtopic.php?f=10&t=2567

Pertex' Combat Library (it has equipment coding in it): viewtopic.php?f=10&t=2660

possibly a useful thread: viewtopic.php?f=10&t=3563&hilit=wearables#p23653

I'll have to look at Pixie's library again as I can't remember it, but I know Chase's covers some of that stuff you want, via using his~her "equipment_layers" and "equipment_slots". There's also the use of "string" and "inherited (object type)" attributes too, which you can check for.

sharky3008
30 May 2013, 10:53
Thanks Hegemonkhan, Chases wearables library was just what I was looking for. I even understood how most of it works although i can't see how the wearable tab magically appeared lol (still very new to this).

george
30 May 2013, 14:45
I think they must have coded in some editor elements. You can do that in Quest, see http://quest5.net/wiki/Using_Types_and_Tabs_(Advanced)#New_Tabs (which is damn cool IMO :) )

HegemonKhan
31 May 2013, 00:22
yes, Chase (and Pixie too) uses (creates) Tabs (the same creation as of the numerous "tabs" already on the GUI-Editor) which uses the GUI-Editor (and thus you, the user) to create many of the attributes, such as the "equipable_slots".

Tabs are very nice for people who use the GUI-Editor, and in some ways+means it can speed up a user's game-making better than with using coding, but trying to code in the tabs isn't as simple as it (might) seem at first, as even if the coding is simple for you, keeping it organized and understood (especially in syncing what you do in the tabs vs outside of the tabs), isn't easy, at least for me, anyways.

--------------

P.S.

Chase codes really well, I think ANYONE can understand his~her code (I knew almost no coding, but wow was it easy to follow and understand his~her code, Chase makes coding difficult stuff look so easy and simple, lol), as it's so concise!

sharky3008
12 Jun 2013, 17:59
HegemonKhan wrote: Chase codes really well, I think ANYONE can understand his~her code (I knew almost no coding, but wow was it easy to follow and understand his~her code, Chase makes coding difficult stuff look so easy and simple, lol), as it's so concise!


I agree 100% :D

However, this is probably way over my head lol.

I was wondering if it is possible to have an extra side panels for clothing only. I am using the wearables library and thought it should be possible to list the items with the attribute 'worn' in a separate box and remove them from the inventory box.

'Examine self' should then reveal your characters appearance and what you are wearing and inventory shouldn't.

I also encountered an error in what I had already done:-

You are in a garden.
You can see a tree (Hanging down is a rope).

> climb rope
You slowly climb up the rope.
Error running script: Error compiling expression 'room.grid_x + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Double'

You are in a tree house.
You can go down.
This is where you used to come as a child to spy on your neighbours.

It works fine if I turn the map off but otherwise I get that error.

Thanks to everyone that is helping with these problems I'm having :wink:

HegemonKhan
12 Jun 2013, 18:44
there's been some threads~posts about whether you can modify the in-game panels, but I can't remember if anyone posted a method of being able to do so, or whether it's not possible (or possible, but requires the other coding languages to be used).

-----

as for the error:

Error running script: Error compiling expression 'room.grid_x + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Double'

I don't know the grid (mapmaking) coding, so I can't help with that, but at the very end of the error, it says:

ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Double'

I believe the "ArithmeticElement" means: one of the "+" ("add") signs

and the " not defined for types 'Object' and 'Double' " just means that... err, this would be hard to explain for this topic, so let me explain for a separate topic instead:

usually it deals with "string" and "int" attribute types:

object.4 as a STRING attribute = object.4 as a INT (INTEGER) attribute -> error as a STRING is not an INT and vice versa
STRING = INT -> error

so the simple fix is this:

GetInt (object.4_STRING_attribute) = (object.4_INT_attribute) -> no error
INT = INT -> no error

GetInt converts a STRING type attribute into an INT (INTEGER) type attribute

------------

also, I've noticed this (not sure if this will fix your problem though), in:

'room.grid_x + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x'

you've got the ".to." in this: exit.to.grid_width/2.0
whereas, no ".to." in this: exit.grid_offset_x

-------------

also the DOUBLE (a number using decimals) type attribute would be your "2.0"

your OBJECT type attribute would be your (object.attribute) "room.grid_x", "room.grid_width", "exit.to.grid_width" (.to. I think would be your verb~command, so: object.verb_command.attribute), and "exit.grid_offset_x"

I also noticed with this "exit.to.grid_width" and "exit.grid_offset_x", that you're missing what OBJECT this belongs or is specifying to (ie there's no ".room." in them, as it should be, I think: "exit.to.room.grid_width" and "exit.room.grid_offset_x")

so, this is ~likely~ (maybe lol) the error with the "OBJECT" error part of it.

the arithmetic operators~elements are the: + (addition), - (subtraction), * (multiplying), / (dividing), = (equals), and <> (not equals). For the not equals, usually you use the "not" logic operator instead, "if (not object.alive=true) then object.dead=true", and not use the <>, as it would require the special "<![CDATA" and "]]>" enclosing the function, telling it that the <> are not coding operators, be like this: <![CDATA[ if (object.alive<>true) then object.dead=true ]]>

the logic operators~elements are: and (and), or (or), >= (equal and greater than), = (equals), not (not), <> (not equals), <= (equal and less than), > (greater than), and < (less than).

----------------

Error running script: Error compiling expression 'room.grid_x + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Double'

your ADD operations (one of these is "undefined"):

1. (+) room.grid_x
2. + room.grid_width
3. + exit.grid_offset_x

Not defined for types "Object and Double":

for DOUBLE (maybe):

3. + exit.grid_offset_x(maybe missing: /2.0)

for OBJECT:

3. + exit.(missing: room.)grid_offset_x

so I'm going to guess, you need to fix #3, maybe just adding the object (".room.") to it, as I don't think you want the /2.0 on it, if I somewhat understand the grid~map coding, lol.

you may also need to include the object for this too:

4. - exit.to.grid_width/2.0

also note that I am presuming that the objects for "4. - exit.to.grid_width/2.0 " and " 3. + exit.(missing: room.)grid_offset_x " have to be "room_2" 's as I think the code is saying move from "room" to ("room_2") and to draw the grid~map for it of course (or no moving, just the grid~map drawing, lol. I don't know how the grid~mapmaking works at all yet, laughs).

--------------------

P.S.

if the panels don't pan out (sorry bad quasi pun hehe), you can use Sora's Stack Library to at least cut down on the cluttering on~in your inventory pane, or you can ask me for my own storage system (though it's only done as a test for spell storage, but you can get the idea of it, I think, and I or someone else could probably make~finish it for things besides just spells, like for "items", unworn equipment, and etc objects)

Also, you could just ignore the panes, and simply create a command~function that displays such "menus or windows" as most rpgs do ("stat screen", "equipment_screen", "spell_screen", and etc).

this is just a quick incompleted example (as I'm still working on trying to do this myself, still trying to learn myself, lol)

(obviously, you'd want an "equipment_screen" to do more than just show you your equipped gear, lol)

<command name="equipment_screen_command">
<pattern>(gearmenu or gear or whatever you want, preferably short lol)</pattern>
<script>
equipment_screen_function
</script>
</command>

<function name="equipment_screen_function">
(just plug in the needed coding that displays your equipped gear, as I don't know equipment coding that well myself and am rusty too as I haven't been working with equipment for awhile, just barely understanding it via Chase, Pixie, and Pertex 's libraries, getting confused still with using equipment, without looking~copying their library coding structures for equipment)
</function>


----------

Sora's Stackable Library:

viewtopic.php?f=18&t=3515

and my own storage structure (it's extremely messy~long, lol, and I did this one for items, not spells):

you can play around with it, though it's for v5.3, hopefully, it can convert easy (ie just change the <asl version="530"> to <asl version="540">) to v5.4, lol. But, it may require more changes for it to convert to v5.4 sighs, maybe you can get a DL still of quest v5.3 to use for this, meh.

<asl version="530">
<include ref="English.aslx"/>
<include ref="Core.aslx"/>
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<pov type="object">player</pov>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
<start type="script">
msg ("Type in \"helpme\" for helpme command")
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<experience type="int">0</experience>
<level type="int">0</level>
<strength type="int">0</strength>
<statusattributes type="stringdictionary">level = ;experience = ;strength =</statusattributes>
</object>
<object name="experience_potion_100_1">
<inherit name="editor_object" />
<alias>potion1001</alias>
<potion type="boolean">true</potion>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
obj = experience_potion_100_1
drink_experience_potion_100_function (obj)
</drink>
</object>
<object name="experience_potion_300_1">
<inherit name="editor_object" />
<alias>potion3001</alias>
<potion type="boolean">true</potion>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
obj = experience_potion_300_1
drink_experience_potion_300_function (obj)
</drink>
</object>
<object name="strength_elixir_100_1">
<inherit name="editor_object" />
<alias>elixir1001</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 100 strength.")
obj = strength_elixir_100_1
drink_strength_elixir_100_function (obj)
</drink>
</object>
<object name="strength_elixir_300_1">
<inherit name="editor_object" />
<alias>elixir3001</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 300 strength.")
obj = strength_elixir_300_1
drink_strength_elixir_300_function (obj)
</drink>
</object>
<object name="experience_potion_100_2">
<inherit name="editor_object" />
<alias>potion1002</alias>
<potion type="boolean">true</potion>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
obj = experience_potion_100_2
drink_experience_potion_100_function (obj)
</drink>
</object>
<object name="experience_potion_300_2">
<inherit name="editor_object" />
<alias>potion3002</alias>
<potion type="boolean">true</potion>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
obj = experience_potion_300_2
drink_experience_potion_300_function (obj)
</drink>
</object>
<object name="strength_elixir_100_2">
<inherit name="editor_object" />
<alias>elixir1002</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 100 strength.")
obj = strength_elixir_100_2
drink_strength_elixir_100_function (obj)
</drink>
</object>
<object name="strength_elixir_300_2">
<inherit name="editor_object" />
<alias>elixir3002</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 300 strength.")
obj = strength_elixir_300_2
drink_strength_elixir_300_function (obj)
</drink>
</object>
<object name="experience_potion_100_3">
<inherit name="editor_object" />
<alias>potion1003</alias>
<potion type="boolean">true</potion>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
obj = experience_potion_100_3
drink_experience_potion_100_function (obj)
</drink>
</object>
<object name="experience_potion_300_3">
<inherit name="editor_object" />
<alias>potion3003</alias>
<potion type="boolean">true</potion>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
obj = experience_potion_300_3
drink_experience_potion_300_function (obj)
</drink>
</object>
<object name="strength_elixir_100_3">
<inherit name="editor_object" />
<alias>elixir1003</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 100 strength.")
obj = strength_elixir_100_3
drink_strength_elixir_100_function (obj)
</drink>
</object>
<object name="strength_elixir_300_3">
<inherit name="editor_object" />
<alias>elixir3003</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 300 strength.")
obj = strength_elixir_300_3
drink_strength_elixir_300_function (obj)
</drink>
</object>
<object name="experience_potion_100_4">
<inherit name="editor_object" />
<alias>potion1004</alias>
<potion type="boolean">true</potion>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
obj = experience_potion_100_4
drink_experience_potion_100_function (obj)
</drink>
</object>
<object name="experience_potion_300_4">
<inherit name="editor_object" />
<alias>potion3004</alias>
<potion type="boolean">true</potion>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
obj = experience_potion_300_4
drink_experience_potion_300_function (obj)
</drink>
</object>
<object name="strength_elixir_100_4">
<inherit name="editor_object" />
<alias>elixir1004</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">100</quality_type>
<capacity type="int">1</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 100 strength.")
obj = strength_elixir_100_4
drink_strength_elixir_100_function (obj)
</drink>
</object>
<object name="strength_elixir_300_4">
<inherit name="editor_object" />
<alias>elixir3004</alias>
<elixir type="boolean">true</elixir>
<quality_type type="int">300</quality_type>
<capacity type="int">3</capacity>
<take />
<drop />
<use />
<give />
<displayverbs>Look at; Take; Drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the str elixir, receiving 300 strength.")
obj = strength_elixir_300_4
drink_strength_elixir_300_function (obj)
</drink>
</object>
</object>
<turnscript name="game_turns_turnscript">
<enabled />
<script>
level_up_function
game_turns_function
</script>
</turnscript>
<command name="help_me_command">
<pattern>helpme</pattern>
<script>
help_me_function
</script>
</command>
<command name="items_command">
<pattern>items</pattern>
<script>
items_function
</script>
</command>
<command name="storage_command">
<pattern>storage</pattern>
<script>
storage_function
</script>
</command>
<command name="restore_items_command">
<pattern>restore</pattern>
<script>
restore_items_function
</script>
</command>
<command name="take_all_command">
<pattern>takeall</pattern>
<script>
take_all_function
</script>
</command>
<command name="drop_all_command">
<pattern>dropall</pattern>
<script>
drop_all_function
</script>
</command>
<command name="capacity_command">
<pattern>capacity</pattern>
<script>
capacity_function
</script>
</command>
<function name="help_me_function">
msg ("Commands: takeall, dropall, storage, items, capacity, restore")
</function>
<function name="take_all_function">
foreach (obj,ScopeReachableNotHeld ()) {
MoveObject (obj,game.pov)
}
</function>
<function name="drop_all_function">
foreach (obj,ScopeInventory ()) {
MoveObject (obj,game.pov.parent)
}
</function>
<function name="items_function">
msg ("potion 100 (" + ListCount (GetDirectChildren (potion_100_storage)) + ")")
msg ("potion 300 (" + ListCount (GetDirectChildren (potion_300_storage)) + ")")
msg ("elixir 100 (" + ListCount (GetDirectChildren (elixir_100_storage)) + ")")
msg ("elixir 300 (" + ListCount (GetDirectChildren (elixir_300_storage)) + ")")
</function>
<function name="capacity_function">
msg ("potion 100 storage: " + potion_100_storage.capacity + " / 9")
msg ("potion 300 storage: " + potion_300_storage.capacity + " / 9")
msg ("elixir 100 storage: " + elixir_100_storage.capacity + " / 9")
msg ("elixir 300 storage: " + elixir_300_storage.capacity + " / 9")
</function>
<function name="restore_items_function">
foreach (obj,GetDirectChildren (item_game_storage)) {
MoveObject (obj,room)
}
</function>
<function name="storage_function"><![CDATA[
show menu ("What do you want to do?",split("deposit;withdraw",";"),true) {
switch (result) {
case ("deposit") {
foreach (obj,ScopeInventory ()) {
if (GetBoolean (obj,"potion") = true) {
if (GetInt (obj,"quality_type") = 100) {
if (potion_100_storage.capacity < 9) {
if (GetInt (potion_100_storage,"capacity") + GetInt (obj,"capacity") <= 9) {
MoveObject (obj,potion_100_storage)
potion_100_storage.capacity = GetInt (potion_100_storage,"capacity") + GetInt (obj,"capacity")
} else {
msg ("There is not enough capacity remaining in your potion 100 storage for the potion you want to store.")
}
} else if (potion_100_storage.capacity = 9) {
msg ("Your potion 100 storage is already full.")
}
} else if (GetInt (obj,"quality_type") = 300) {
if (potion_300_storage.capacity < 9) {
if (GetInt (potion_300_storage,"capacity") + GetInt (obj,"capacity") <= 9) {
MoveObject (obj,potion_300_storage)
potion_300_storage.capacity = GetInt (potion_300_storage,"capacity") + GetInt (obj,"capacity")
} else {
msg ("There is not enough capacity remaining in your potion 300 storage for the potion you want to store.")
}
} else if (potion_300_storage.capacity = 9) {
msg ("Your potion storage is already full.")
}
}
} else if (GetBoolean (obj,"elixir") = true) {
if (GetInt (obj,"quality_type") = 100) {
if (elixir_100_storage.capacity < 9) {
if (GetInt (elixir_100_storage,"capacity") + GetInt (obj,"capacity") <= 9) {
MoveObject (obj,elixir_100_storage)
elixir_100_storage.capacity = GetInt (elixir_100_storage,"capacity") + GetInt (obj,"capacity")
} else {
msg ("There is not enough capacity remaining in your elixir 100 storage for the elixir that you want to deposit.")
}
} else if (elixir_100_storage.capacity = 9) {
msg ("Your elixir storage is already full.")
}
} else if (GetInt (obj,"quality_type") = 300) {
if (elixir_300_storage.capacity < 9) {
if (GetInt (elixir_300_storage,"capacity") + GetInt (obj,"capacity") <= 9) {
MoveObject (obj,elixir_300_storage)
elixir_300_storage.capacity = GetInt (elixir_300_storage,"capacity") + GetInt (obj,"capacity")
} else {
msg ("There is not enough capacity remaining in your elixir 300 storage for the elixir that you want to deposit.")
}
} else if (elixir_300_storage.capacity = 9) {
msg ("Your elixir 300 storage is already full.")
}
}
} else {
msg ("This object can't be stored.")
}
}
}
case ("withdraw") {
show menu ("What do you want to do?", split ("potion;elixir",";"),true) {
switch (result) {
case ("potion") {
show menu ("What do you want to do?", split ("100;300",";"),true) {
switch (result) {
case ("100") {
withdraw_potion_100
}
case ("300") {
withdraw_potion_300
}
}
}
}
case ("elixir") {
show menu ("What do you want to do?", split ("100;300",";"),true) {
switch (result) {
case ("100") {
withdraw_elixir_100
}
case ("300") {
withdraw_elixir_300
}
}
}
}
}
}
}
}
}
]]></function>
<function name="withdraw_potion_100">
foreach (obj,GetDirectChildren (potion_100_storage)) {
potion_100_storage.capacity = GetInt (potion_100_storage,"capacity") - GetInt (obj,"capacity")
MoveObject (obj,game.pov)
}
</function>
<function name="withdraw_elixir_100">
foreach (obj,GetDirectChildren (elixir_100_storage)) {
elixir_100_storage.capacity = GetInt (elixir_100_storage,"capacity") - GetInt (obj,"capacity")
MoveObject (obj,game.pov)
}
</function>
<function name="withdraw_potion_300">
foreach (obj,GetDirectChildren (potion_300_storage)) {
potion_300_storage.capacity = GetInt (potion_300_storage,"capacity") - GetInt (obj,"capacity")
MoveObject (obj,game.pov)
}
</function>
<function name="withdraw_elixir_300">
foreach (obj,GetDirectChildren (elixir_300_storage)) {
elixir_300_storage.capacity = GetInt (elixir_300_storage,"capacity") - GetInt (obj,"capacity")
MoveObject (obj,game.pov)
}
</function>
<function name="drink_experience_potion_100_function" parameters="obj">
game.pov.experience = game.pov.experience + 100
MoveObject (obj,item_game_storage)
</function>
<function name="drink_experience_potion_300_function" parameters="obj">
game.pov.experience = game.pov.experience + 300
MoveObject (obj,item_game_storage)
</function>
<function name="drink_strength_elixir_100_function" parameters="obj">
game.pov.strength = game.pov.strength + 100
MoveObject (obj,item_game_storage)
</function>
<function name="drink_strength_elixir_300_function" parameters="obj">
game.pov.strength = game.pov.strength + 300
MoveObject (obj,item_game_storage)
</function>
<function name="game_turns_function">
game.turns = game.turns + 1
</function>
<function name="level_increase_function">
game.pov.level = game.pov.level + 1
</function>
<function name="level_experience_overflow_function">
game.pov.experience = game.pov.experience - (game.pov.level * 100 + 100)
</function>
<function name="level_up_function"><![CDATA[
if (game.pov.experience >= game.pov.level * 100 + 100) {
level_experience_overflow_function
level_increase_function
level_up_function
}
]]></function>
<object name="item_player_storage">
<parent>null</parent>
<inherit name="editor_object" />
<object name="potion_storage">
<inherit name="editor_object" />
<object name="potion_100_storage">
<inherit name="editor_object" />
<capacity type="int">0</capacity>
</object>
<object name="potion_300_storage">
<inherit name="editor_object" />
<capacity type="int">0</capacity>
</object>
</object>
<object name="elixir_storage">
<inherit name="editor_object" />
<object name="elixir_100_storage">
<inherit name="editor_object" />
<capacity type="int">0</capacity>
</object>
<object name="elixir_300_storage">
<inherit name="editor_object" />
<capacity type="int">0</capacity>
</object>
</object>
</object>
<object name="item_game_storage">
<inherit name="editor_object" />
<parent>null</parent>
</object>
</asl>

sharky3008
12 Jun 2013, 19:55
If I turn Map off it works perfectly and if I have the player climb down a rope to get back out of the tree house it works perfectly too, seems it's just because i thought 'down' would be better than 'climb rope' to get back down. Having 'ascend rope' and 'descend rope' just doesn't sound right lol.
As for all the information you just gave me about the error <whooshhhhhhhhhhhh> straight over my head i'm afraid lol
I will try to work it out bit by bit, but in the meantime, 'climb rope' will have to do.

HegemonKhan
13 Jun 2013, 00:28
my bad, I didn't exactly explain that very clearly, and I'm not really sure what the problem is myself, as I haven't worked with the grid~map coding yet. Though, usually errors are just from typos, not having the exact syntax~format that is required, such as missing something or not matching up stuff (in the case of the types of attributes).

the others, who know know coding much better, can probably quickly provide what the correction needs to be for it to work.

sharky3008
13 Jun 2013, 09:58
I feel as if I'm now being a pest but I am trying to make a command for 'climb up/down object' just because I think it looks better and would be useful for things like ladders and scaffolding as well as the rope I already have. I want the up/down to be linked to the direction obviously but not to show on the compass (so you wouldn't be able to just type or click 'Up' or 'Down', problem is I have no idea where to start on this.

Good news though, I actually managed to make a command for 'show object1 to object2' that works perfectly (I think) and I did it all on my own lol
(perhaps there's hope for me yet)

Liam315
13 Jun 2013, 12:55
I think you can stop exits from showing up on the compass by marking them as "scenery." If you don't want the player to be able to just type GO UP or GO DOWN however, you'll have to delete the exit entirely. You don't necessarily need an exit present to move a player between rooms if you're going to be using other commands like climb.

For climbing, creating a climb up and climb down verb should be sufficient and apply them to the verb list of whatever object (rope, ladder etc.) that you're using. In the script for the verb, just use the MoveObject script to move the player to the desired room.