TAB - thinBasic Adventure Builder

T.A.B. is an interactive fiction/text adventure program for Windows and made with thinBasic.
 
HomeFAQSearchUsergroupsRegisterLog in
Latest topics
» TAB Version 66 Available
Mon Sep 26, 2016 12:02 pm by catventure

» TAB Version 65 Available
Mon Feb 23, 2015 12:04 pm by catventure

» Incubation pt 1
Wed Apr 24, 2013 9:24 am by Kabrinski

» Charecter movements - doors
Wed Mar 20, 2013 2:55 pm by garethfx

» Member feedback on game planning
Sun Mar 03, 2013 1:47 pm by garethfx

» Still alive - just!
Thu Feb 28, 2013 11:34 am by catventure

» TAB 64 crashes ...
Mon Aug 20, 2012 11:31 am by acko

» Idea on addition to object being container
Sat Aug 18, 2012 3:49 pm by catventure

» sizex=y action ...
Thu Aug 09, 2012 11:29 am 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 : 59
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

PostSubject: using multiples of the same object?   Sat 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
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 65
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: using multiples of the same object?   Sat 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.

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
garethfx
Experienced Adventurer


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

PostSubject: Re: using multiples of the same object?   Sun 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
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 65
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: using multiples of the same object?   Sun 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.

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
garethfx
Experienced Adventurer


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

PostSubject: Re: using multiples of the same object?   Sun 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
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 65
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: using multiples of the same object?   Sun 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.

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
garethfx
Experienced Adventurer


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

PostSubject: multiple count on INVENTORY (i)   Sun 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
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 65
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: using multiples of the same object?   Sun 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.

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
garethfx
Experienced Adventurer


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

PostSubject: Re: using multiples of the same object?   Sun 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
View user profile
Sponsored content




PostSubject: Re: using multiples of the same object?   

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: