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 | 
 

 Simple way of restricting the "placing" or "dropping" on to a Noun

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: Simple way of restricting the "placing" or "dropping" on to a Noun   Mon Sep 19, 2011 1:03 pm

Hi Phil and friends...

Just had one of my - how do I do.... moments, read the manuals and delved in to examples but Im not quite there.

Im using this code for accepting the player to drop x on to a cooker (in this case) - I did plan that the ccoker will have a small but neat little puzzle for the game

The code is;

[start]drop %objn1% on cooker#room=22#objlocn1=here#objn1size<=2[acts]cmessYou place the %objn1% on cooker..#objlocn1=204#else#room=22#objlocn1=here#objn1size>2[acts]cmessThe %objn1% is too large or bulky to fit on the cooker I'm afraid![end]

No this code and the examine and get code work fine with no issues but as its a cooker I want to restrict some items and allow some (hope that garble is clear?) Ive thought about using the size and weights to do this and yes they do work but there will be items in the carrying game that are the same as the allowable obs. - e.g. I want the copper pan to go on the cooker and be used but a wooden item will burn and I dont want that to have to code against.

is there a simple add to this or do you think its beter to stear away from to much minute detail and basically force size/weights to restrict and accept that some items may be placed there with some obvious consequences?
G
Back to top Go down
View user profile
catventure
Admin Adventurer
avatar

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

PostSubject: Re: Simple way of restricting the "placing" or "dropping" on to a Noun   Mon Sep 19, 2011 6:59 pm

Hi Gareth,

My first thought is that you could have ONLY the objects that could be allowed to be placed on the cooker all have the SAME WEIGHT....

For instance if allowable objects on the cooker all had a weight value of 2

No other objects in the game therefore could have the that value - only the set of objects that could be placed on the cooker....

And then you could do:

[start]drop %objn1% on cooker#room=22#objlocn1=here#objn1size=2[acts]cmessYou place the %objn1% on the cooker..#objlocn1=204#else#room=22#objlocn1=here#or_objn1size<2#or_objn1size>2[acts]cmessThe %objn1% is not something you would put on a cooker![end]

'========

My other suggestion is to place another entry ABOVE your original that deals with the objects that lie within the acceptable weight range but are not meant to be put on the cooker for various reasons:

[start]drop %objn1% on cooker#room=22#objlocn1=here#objn1size<=2#objn1<>x#objn1<>x#objn1<>x#objn1<>x#....etc...[acts]cmessThe %objn1% is not an appropriate object to place on the cooker, I'm afraid![end]

rem: you have several #objn1<>x# conditions..
x being the numbers of ALL the several objects which ARE allowed on the cooker

[start]drop %objn1% on cooker#room=22#objlocn1=here#objn1size<=2[acts]cmessYou place the %objn1% on cooker..#objlocn1=204#else#room=22#objlocn1=here#objn1size>2[acts]cmessThe %objn1% is too large or bulky to fit on the cooker I'm afraid![end]

However I think my first idea was probably better...?! Surprised

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: Simple way of restricting the "placing" or "dropping" on to a Noun   Tue Sep 20, 2011 7:38 pm

HI Phil.

Yes I think Op 1 is the best as it appears to be the least labour intensive and of course less code to mistype and have to debug. Just thought Id ask incase there was a more simplisting and new way of restricting.

Thanks again

Gareth
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Simple way of restricting the "placing" or "dropping" on to a Noun   

Back to top Go down
 

Simple way of restricting the "placing" or "dropping" on to a Noun

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: