| Advice on 1 object-multi locations requiring swopping | |
|
Author | Message |
---|
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Advice on 1 object-multi locations requiring swopping Sun Oct 04, 2009 7:13 pm | |
| HI All
Just a simple query. I have a plot requiring a gaslamp being unlit until lit by player. Im using ONE obect for the unlit lamp and ONE for the Lit lamp. I have set it so that in scritp 1 the unlit lamp appears in rooms 6 to 13 inclusive - that works fine.
Having created responses for turn on the gas, setting a timers o player may gas them selves, lighting the gas lamp, and swopping unlit for lit followed by a DESC to allow the play to see the room. I am now expanding the flags to account for the remainder of the rooms.
Now at last the query.............
In the responses what is the correct (if there is one) method of placing responses for each of the lamps (flags) so that they work most effectivley. Would you place all the "turn gas on" commands sequencially, then follow these with all the "light the gas" commands again sequencially etc or
Is it more appropriate to place all the commands for one lamp (flag) in a block so that each Response for a given lamp is kept in block
Hope Ive made myself clear here?
GAreth |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Advice on 1 object-multi locations requiring swopping Mon Oct 05, 2009 3:54 pm | |
| Hi Gareth,
It's good to hear you've made some progress on the "gas" light/dark puzzle. I don't think there's any hard or fast rule about the structure of the coding, but it certainly makes sense to group similar blocks of commands together especially when debugging/checking entries later etc. Amy did this for some of the Response entries in her "Realm of Obsidian" game. But it is really a matter of preference to the individual author. Having lots of text indicators as headers before certain entries can help identify particular portions of the Response list.
As in CAT some entries might need to be placed BEFORE other entries so that they are checked or activated instead of following ones...
Don't forget you can save your Response entries out as a text file to use in Notepad where you have better editing facilities and then you can load it back into TAB Responses but remember to SAVE DATA to update the game with the revised file.
Regards, Phil. |
|
| |
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Re: Advice on 1 object-multi locations requiring swopping Mon Oct 05, 2009 4:54 pm | |
| Thats great
NOW! Having programmed lamp 1 in my first loaction the process works well. This includes the turning on and off of gas, setting a timer to gas the player (nice eh?) being able to light the gas/lamp. Hiowever, I thought in my infinate wisedom (all 3 grammes of it) That it would be a good move to copy the working code and just change the location, flag for on,off and lit and of course the timer. I made an enter in script that places the static unlit lamp in locations >5 and <14 - yep - that works but Im flumuxed on the swop in the second location. Ive placed the code for both swops below - As far as I can see its right but when I test it Im getting the UNLIT lamp and the LIT lamp in the listing in room 7.
Been at it since Sunday night and still cannot see where Im making a mistake
[start]light gas/light lamp/light the lamp with the lighter#here2#room=6#flag51=1[acts]swapobjs3,4#objn2=4#itnoun=objn2#cmessThe room is bathed in a greeny yellow glow from the burning gaslamp.#flag51=2#flag61=0#timeout=0#desc[end]
[start]light gas/light lamp/light the lamp with the lighter#here2#room=7#flag52=1[acts]swapobjs3,4#objn2=4#itnoun=objn2#cmessThe room is bathed in a greeny yellow glow from the burning gaslamp.#flag52=2#flag62=0#timeout=0#desc[end]
Gas lamp at 7. Flag 52 used. if flag 52 = 0 the lamp will be off if flag 52 = 1 the lamp will be on but not lit if flag 52 = 2 the lamp will be lit.
the same applies for room 6 except that flag 51 is used
Flags 61 and 6 are the "gassing" flags |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Advice on 1 object-multi locations requiring swopping Mon Oct 05, 2009 6:40 pm | |
| Hi Gareth, First off you can't use deletion words in words conditions - they must be KEYWORDS only so "the" must be removed from the entries so it reads: "light lamp with lighter" [start]light gas/light lamp/light lamp with lighter#here2#room=6#flag51=1[acts]swapobjs3,4#objn2=4#itnoun=objn2#cmessThe room is bathed in a greeny yellow glow from the burning gaslamp.#flag51=2#flag61=0#timeout=0#desc[end] [start]light gas/light lamp/light lamp with lighter#here2#room=7#flag52=1[acts]swapobjs3,4#objn2=4#itnoun=objn2#cmessThe room is bathed in a greeny yellow glow from the burning gaslamp.#flag52=2#flag62=0#timeout=0#desc[end] If the unlit lamp is still appearing in the location it is probably to do with the Script 1 entries with the flags... I don't think you can do it with just ONE entry for the several rooms eg: room>5#room<14 but I think you must have a separate entry for each of the rooms. Of course, it's difficult to say without seeing the code... Also may be better instead of "#swapobjs3,4#" in this case to instead remove the unlit lamp object (3) from the game with "destroy3" and then use "create4" to replace it with the lit one. The unlit lamp object will still turn up in the dark rooms because of the Script 1 entries. The other problem to be dealt with will be entries in Script 2 to deal with letting TAB know which lamp is being referred to by the player when the player types in the object noun "lamp"... The player might be in a dark or ligh room therefore TAB needs to know which "lamp" is meant. I've reproduced some code below from the other darkness thread to show you what I mean... - Code:
-
Object 7 is an unlit torch Object 8 is a brightly lit torch
Now a bit of explanation: When TAB parses an input line typed by the player it will extract the FIRST occurrence in the Vocabulary lists for a matching word or synonym and then convert it to the KEYWORD so as to process the Response list of entries. This means that either or both the parser variables "objn1" and "objn2" will be holding a value of 7 should the player have typed eg:
switch on torch
or,
switch torch on
or, if they have been extremely silly, something like:
switch torch on torch
One or both of those object noun parser variables will hold a value of 7 irrespective of which torch exists in the game.
So we need to put ONE single special entry right at the beginning of Response that starts with words conditions:
%_%
which means the entry will trigger WHATEVER command the player types in.
We need to do this to check the "words conditions" every time in case the player has typed a phrase containing an object noun "torch". Why? Because we need to change the object noun(s) numbers from 7 to hold a value of 8 should the unlit torch no longer exist in the game after it is swapped for the lit torch when the unlit torch is turned on. In other words this rather complex looking entry ensures that the correct torch object will be used and recognised by TAB
Here it is:
[start]%_%#objn2=7#objn1=7#objloc7=0[acts]objn1=8#objn2=8#jumpSTART#else#objn1=7#objn2<>7#objloc7=0[acts]objn1=8#jumpSTART#else#objn2=7#objn1<>7#objloc7=0#objn2=8#jumpSTART[end]
following this we create a LABEL in the Response list. I've called the label START (but you can call it anything you like) The LABEL goes directly under the entry and has a colon appended to it like so:
START:
The "jumpLABEL" action - if done - will cause TAB to JUMP to the named label BELOW and then continue checking Response entries from that point to find a match.
Analyzing the entry carefully you will see that it looks to see IF parser variables "objn1" and/or "objn2" are equal to 7. IF the unlit torch has been destroyed (removed from game) and set to location 0 THEN it sets the objn1 and/or objn2 to be 8 (number of lit torch) instead.
If this entry was done by TAB it will carry out all subsequent player actions and commands regarding the torch as if it were the "lit torch" (with its lightsource attribute)
eg:
>examine torch
The torch glows brightly with a strong beam of light.
When the torch is switched off and the 2 torches have exchanged places again the above entry will be scanned but not done because the unlit torch (Object 7) will now exist and no longer be in location 0... so TAB will "know" that it is now the unlit torch which needs to be acted upon.
eg:
>examine torch
The torch has an on/off switch. It is currently OFF.
The entries above regarding a "torch" can be modified for any similar scenario in your own games and is placed here as reference material.
Your puzzle is slightly different because you have multiple lighted objects with the same noun name and not all will be non-existent in the game at the same time... Regards, Phil. |
|
| |
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Re: Advice on 1 object-multi locations requiring swopping Mon Oct 05, 2009 7:04 pm | |
| AHHHHHHHH! The penny doth drop!
Yep I see your points. And supprisingly enough I actually understood what you were saying from the off
I had read throught the code previously but I think in my entusiasum to create the master piece I read but didnt digest..............
Ill get to work on this immeadiatley - The concept of destroy and create seems to be a more suitable in the contect of the game anyway as the player will rearly need to actually turn the gas off in any of the locations as the marjority take place in a Parisian Theatre at the turn of the century indeed, it may be worth a re-write of the game plan to make the light factor a oil lantern instead - a cowards way out by when learning its better to climb a hill not the whole mountain - maybe the "gaslamp" will appear at a more strategic point and where it will be of greater benefit
Many thanks Phil........ Its realy is appreaciated
Gareth |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Advice on 1 object-multi locations requiring swopping Mon Oct 05, 2009 7:44 pm | |
| Hi Gareth, I still think it can be done but it would be so much easier just having the ONE static "lit lamp" object only... and use Script 1 to tell the player there is an unlit gas lamp in the room. Maybe the "lighter" object could be set on the Object Editor to NOT be a lightsource... - that would ensure the System Message 78 ("It's dark") appears properly in the dark rooms. So you'd have an ORDINARY noun "lamp" and an OBJECT NOUN "lamp" Better with just ONE object to deal with! Be so much easier to create the 'parser' code I was on about in the last post too.. Nothing wrong with an oil lamp I suppose! Phil. PS. Your planned game sounds interesting. Is it a historical mystery then?? |
|
| |
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Re: Advice on 1 object-multi locations requiring swopping Mon Oct 05, 2009 9:28 pm | |
| Yep - Im planning it around the Phantom of the Opera Because its a theatre the locations can be as wide and varied as I like Ill probabley add some music (but not the copyright version of Lloyd webber) Though that would be great as its so atmospheric - but I cant cope with the legal costs lol I just hope I dont get daunted with the learning process combined with actual build. but we can but try |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Advice on 1 object-multi locations requiring swopping Tue Oct 06, 2009 8:40 am | |
| Hi Gareth, Here is a link to the original B/W movie from 1929... It's free to watch or download as it is now Public Domain http://www.archive.org/details/ThePhantomoftheOperaThe good thing about this site is that there are tons of other classic movies that can be watched free in A-Z order too Not been able to find any free opera type music for free use in games yet. Cheers, Phil. |
|
| |
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Re: Advice on 1 object-multi locations requiring swopping Tue Oct 06, 2009 10:46 am | |
| WOOOWWWW Yep seen that and the next version with herbut lome Im just picking up on the piece of music the phantom plays on the giant organ......... Toccata and Fugue in D minor for Organ - its available in arange of formats so ill get that - Im sure ive seen it as a computer music file some where so Ill be able to use that - we'll see what we get this is the music anyway and a place to find so stuff http://www.mfiles.co.uk/classical-mp3.htmGareth |
|
| |
Sponsored content
| Subject: Re: Advice on 1 object-multi locations requiring swopping | |
| |
|
| |
| Advice on 1 object-multi locations requiring swopping | |
|