View previous topic :: View next topic |
Author |
Message |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Mar 27, 2005 3:12 am Post subject: How do I limit the use of a shop ? |
|
|
I would like my hero not be able a shop after he has used a shop 4 or 5 times ? Does somoene can tell me if there is a way to do that ? if yes could you explain me how ? if not could somoene give a method without using shops ?
Thank you very much for the help! |
|
Back to top |
|
 |
Jack the fool

Joined: 30 Jul 2004 Posts: 773
|
Posted: Sun Mar 27, 2005 4:55 am Post subject: |
|
|
you could use tags.
have the 'use shop #--' tag on the first text box. then set a tag so that the next time you talk to the guy, a new text box comes up. then do the same thing until the 4 or 5th text box.
i dunno if you can understand that clear enough, if you need more help ill try and describe more. _________________
 |
|
Back to top |
|
 |
Leo The wizard of many faces...

Joined: 02 Nov 2004 Posts: 95 Location: Way far up north in Sweden...
|
Posted: Sun Mar 27, 2005 5:09 am Post subject: |
|
|
Use a global variable. Something like this:
Code: | global variable (1,var)
script,shop,begin
if (var<=4) then
begin
increment (var,1)
use shop (?) #shop number
end
else (?) #whatever you want to happen after 4 times
end |
run this from the shop npc _________________ "A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-Douglas Adams
Download Zander (Swedish)
or Zander (English) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Mar 27, 2005 6:14 am Post subject: |
|
|
Change
if (var<=4) then
to
if (var<<4) then
and then change the '4' to how ever many times you want the shop to be available. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Mar 27, 2005 11:50 pm Post subject: Ok I think the variable is ok but... |
|
|
Variable is ok! You talked 4 times to the shop keeper and then another text box appear.
Could somoene give details with the tags ? I don't understand very well. Does such an operation suppose that you should use 4 tags ?
I think it would be a good idea to make it clear!
Thanks in advance! |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Mon Mar 28, 2005 10:42 am Post subject: |
|
|
Basically, what you want is this: (I adapted Leo's script)
Code: | global variable (1,shop used)
script,shop,begin
if (shop used<=4) then
begin
increment (shopused,1)
use shop (shop:my shop) #shop number
end
else
begin
show text box (667) #shopkeeper: fug off
end
end |
Later, if you want to make the shop available again, use a script like this:
Code: | script,reset shop, begin
shop used:= 0
end |
If you THEN want to make the shop available forever, you need to be more devious:
Code: | script, perma reset shop, begin
shop used:= -1
end
#this is the first script, but changed around
#it will not increment "shop used" if it == -1
script,shop,begin
if (shop used<=4) then
begin
if (shop used > -1) then (increment (shopused,1))
use shop (shop:my shop) #shop number
end
else
begin
show text box (667) #shopkeeper: fug off
end
end |
_________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Mar 30, 2005 2:10 am Post subject: |
|
|
There are no tags involved. If you already have other global variables, change the id number of the global 'var' (or in pkmnfrk's version, 'shop used') _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|