| using multiples of the same object? | |
|
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: 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 |
|
| |
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: 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.
|
|
| |
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: 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 |
|
| |
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: 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. |
|
| |
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: 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]
|
|
| |
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: 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 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: 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 |
|
| |
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: 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. |
|
| |
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: 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 |
|
| |
Sponsored content
| Subject: Re: using multiples of the same object? | |
| |
|
| |
| using multiples of the same object? | |
|