TAB - thinBasic Adventure Builder
Would you like to react to this message? Create an account in a few clicks or log in to continue.

TAB - thinBasic Adventure Builder

T.A.B. is an interactive fiction/text adventure program for Windows and made with thinBasic.
 
HomeLatest imagesSearchRegisterLog in
Latest topics
» Happy New Year 2024!
using multiples of the same object? I_icon_minitimeSun Dec 31, 2023 4:04 pm by catventure

» TAB Version 71
using multiples of the same object? I_icon_minitimeMon Aug 21, 2023 12:17 pm by catventure

» TAB Version 70
using multiples of the same object? I_icon_minitimeSun Oct 02, 2022 1:49 pm by catventure

» TAB Version 70
using multiples of the same object? I_icon_minitimeFri Sep 30, 2022 10:23 pm by catventure

» TAB Version 70
using multiples of the same object? I_icon_minitimeMon May 23, 2022 4:08 pm by catventure

» TAB Version 70
using multiples of the same object? I_icon_minitimeSat Apr 30, 2022 11:15 am by catventure

» TAB Version 70
using multiples of the same object? I_icon_minitimeSat Apr 23, 2022 2:32 pm by catventure

» TAB Version 68 Update
using multiples of the same object? I_icon_minitimeTue Mar 15, 2022 4:18 pm by catventure

» TAB Version 68 Update
using multiples of the same object? I_icon_minitimeFri Mar 11, 2022 8:47 pm by catventure


Share | 
 

 using multiples of the same object?

View previous topic View next topic Go down 
AuthorMessage
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 66
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

using multiples of the same object? Empty
PostSubject: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSat Jul 24, 2010 4:50 pm

Hi all

Just wanted to add a smalll eating puzzle to a game plan

Ive allocated flag 40 to the amount of, example sweets. These come in a bag

Firstly - which is the best way to configure the programme so that the player can take a sweet, eat or leave it at a location ?

I can understand the decflag40,1 situation and have set flag 40 in script 2 as 10 (initally) for the game start.
in the reponse Ive added;

[start]get sweet#objloc193=501#flag40>0[acts]cmess you take a sweet#decflag40,1[end]

In the object table ive described the sweet packet and in the desription added
In the bag is %flag40% sweet(s) - this I thought should report the value of flag 40


(this is to test the command at first)
However, when I examine the packet after taking a sweet It still reports 10 sweets and not 9 as it should - any ideas??

Gareth
Back to top Go down
catventure
Admin Adventurer
catventure

Male
Number of posts : 404
Age : 71
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 77
Registration date : 2008-06-08

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSat Jul 24, 2010 5:25 pm

Hi Gareth,

Seems like a good way of doing it.

Can you show your entry in Script 2 that sets the sweets to 10 initially.

Possibly this entry is causing the problem - it may be being triggered every turn thus resetting the flag 40 to 10 each time....?

catventure.
Back to top Go down
https://adventure.forumotion.com
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 66
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 1:31 pm

Great! Thanks Phil

I thougt it may have been wrong - its the first time ive attempted a complex multi object - if this works There will be a requirements to a few others

In script 2 - I placed this right at the very start.

[start][acts]flag40=10[end]

Looking at it I think Ive missed something as well because reading this logically Eveytime TAB parses this it has to reset to 10 .............................

G
Back to top Go down
catventure
Admin Adventurer
catventure

Male
Number of posts : 404
Age : 71
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 77
Registration date : 2008-06-08

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 2:02 pm

Hi Gareth,

You need to change it to something like:

[start]flagX=0[acts]flagX=1#flag40=10[end]

Where X is a another spare flag number...

This will now set flag 40 to 10 at the start - and the entry will not trigger again unless you change flag X to equal 0 again...

Phil.
Back to top Go down
https://adventure.forumotion.com
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 66
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 2:40 pm

Arrr right - got it......

Therefore, if I'm not mistaken if I have a number of flags that will need a "default" setting at game start I could simply add them in after the [acts] -eg.
[start]flagX=0[acts]flagX=1#flag40=10#flag41=20 etc etc etc[end]

Back to top Go down
catventure
Admin Adventurer
catventure

Male
Number of posts : 404
Age : 71
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 77
Registration date : 2008-06-08

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 4:16 pm

garethfx wrote:
Arrr right - got it......

Therefore, if I'm not mistaken if I have a number of flags that will need a "default" setting at game start I could simply add them in after the [acts] -eg.
[start]flagX=0[acts]flagX=1#flag40=10#flag41=20 etc etc etc[end]


Exactly, yes Smile

Phil.
Back to top Go down
https://adventure.forumotion.com
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 66
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

using multiples of the same object? Empty
PostSubject: multiple count on INVENTORY (i)   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 4:41 pm

Just as a matter of interest Phil

All my flags are counting down nicely for the sweet packet. However, any suggestions for the Inventory side of the issue. If the player takes a sweet from a bag I have eg 9 in the bag and of course one in the hand as it were I can "create" a sweet object to 501 - but how do I do that for 2,3 ,4 etc as the Inventory doesnt seem to account for that flaged items - Interesting this I think - has anybody done that one ??

I did think of making objects for 2, 3, 4 etc sweets but I dont know if that will work OR am I over thinking this???

TY

Gar
Back to top Go down
catventure
Admin Adventurer
catventure

Male
Number of posts : 404
Age : 71
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 77
Registration date : 2008-06-08

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 6:40 pm

Hi Gareth,

I do not know of the significance of the sweets in your game or if they warrant the extra entries that would be required..
Well I think it can be done but it's just a LOT more trickier. It depends whether you think it's worth it or not.

On the inventory side we can use another spare flag. I will use flag 100 in this example.

Whenever the player takes a sweet from the bag you would need to increase the flag 100 by one. Whenever the player eats a sweet or drops a sweet etc.. you would need to decrease the flag 100 by one. This will most likely happen in your RESPONSE entries for those commands.

You will need to alter the default inventory RESPONSE entry to something like:

[start]i[acts]inven#call_flag100>0[acts]cmessYou are also holding %flag100% sweet(s).[end]

This prints player inventory and then using the "call_" prefix goes back into CONDITIONS and checks to see if flag 100 is greater than 0 (any sweets in player's hands)
If so it appends an extra "cmess" telling the player how many...

Note there is no actual "sweet" object created in the object editor!

It will be more difficult if you want messages in the location where a sweet may be dropped. Or if the player puts the sweet back into the bag or if the player gives a sweet to a character etc...
It is going to mean the use of more flags and more condition checks etc...

On the other hand you could simply make it that if a sweet were "dropped" or given away it could just no longer exist in the game which would make things a lot easier.

Phil.
Back to top Go down
https://adventure.forumotion.com
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 66
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitimeSun Jul 25, 2010 8:32 pm

That was great Phil.

Ive down graded the sweet puzzle until a later time. As my skills buuld then Ill look at the complex side again

The example was just what i needed as there are one or two more little puzzles that will use the code

as always im greatful many thanks

G
Back to top Go down
Sponsored content




using multiples of the same object? Empty
PostSubject: Re: using multiples of the same object?   using multiples of the same object? I_icon_minitime

Back to top Go down
 

using multiples of the same object?

View previous topic View next topic Back to top 

 Similar topics

+
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
TAB - thinBasic Adventure Builder :: TAB FORUMS :: General Forum-
Jump to: