Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, bigsmack, monarch), 1,240 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
It does what it likes -.- #306650
01/23/10 21:00
01/23/10 21:00
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
Hi, me again.
I'm programming on a little rpg and I made this little very easy code to check, if the player went out 5 fire:

while(firenumber<5){wait(1);} //wait as long as the player went out all fires

And in the function from the fire:

if( -water on me-)
firenumber+=1;

But now, if I went out all fires ingame, nothing happens. I made a digit for the variable firenumber, and it's on 5 and anyway nothing happens. I worked with beep(); so i'm sure the fault is in the Code, which I wrote here.


Hilf mir, dir zu helfen!
Re: It does what it likes -.- [Re: hopfel] #306656
01/23/10 21:53
01/23/10 21:53
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
try to first set firenumber to 5 at start, to see if
the stuff after the while works.
If this works, test if the "water an" condition is triggered correctly.

Re: It does what it likes -.- [Re: Oxy] #306658
01/23/10 22:04
01/23/10 22:04
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
I tried this:

beep();
while(firenumber<5){wait(1);}
beep();

The first beep comed, but not the second smirk
And how I said, I made a digit on a panel for the variable "firenumber", and it counts fine...

EDIT:
I tried this:

beep();
while(firenumber<5){beep();wait(-1);} //beep every second
beep();beep();beep();beep(); //make four fast beeps

Ingame, it beeped first, then it beeped every second.
But when I extinguished one fire, it stopped beeping, but not four fast beeps. The whole function got stuck (maybe) It's so confusing :S

Last edited by hopfel; 01/23/10 22:12.

Hilf mir, dir zu helfen!
Re: It does what it likes -.- [Re: hopfel] #306724
01/24/10 14:39
01/24/10 14:39
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

try

Code:
beep();
while(firenumber<5)
{
    for (var i=1; i<5; i++)
         {
           beep();wait(-1);
         } //beep every second
 }



not tested



Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: It does what it likes -.- [Re: Ottawa] #306727
01/24/10 14:55
01/24/10 14:55
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
no, it did the same... first beep comed and then it beeped every second, if I extinguished one of the five fires, it stopped beeping.


Hilf mir, dir zu helfen!
Re: It does what it likes -.- [Re: hopfel] #306728
01/24/10 15:08
01/24/10 15:08
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi hopfel!
Quote:

if I extinguished one of the five fires, it stopped beeping


Verify your panel to make sure that it shows the numbers going from
1 to 5.

Make the wait longer to slow things down.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: It does what it likes -.- [Re: Ottawa] #306733
01/24/10 15:35
01/24/10 15:35
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
I wrote this code:
beep();
var i = 0;
while(firenumber<5)
{
for (i=1; i<5; i++)
{
test = i;
beep();wait(-2);
} //beep every second
}

This was the operational sequence:

- firenumber = 0
*beep*
*beep*
(1 second later)
*beep*
- i = 1
(1 second later)
*beep*
- i = 2
(1 second later)
*beep*
- i = 3
(1 second later)
*beep*
- i = 4
(1 second later)
*beep*
- i = 1
- I extinguished one of the five fires
- firenumber = 1
(1 second later)
-nothing happened, i stayed on 1.
- I extinguished the other four fires
- firenumber = 5
- nothing happened


I think it's the same strange problem from here:

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=36996&Number=302333#Post302333


Hilf mir, dir zu helfen!
Re: It does what it likes -.- [Re: hopfel] #306740
01/24/10 16:13
01/24/10 16:13
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Once the value of firenumber is 5 it stays 5 until you reset it in your code.
Do you reset it for the next fire?


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: It does what it likes -.- [Re: Ottawa] #306758
01/24/10 18:57
01/24/10 18:57
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline OP
User
hopfel  Offline OP
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
On the digit the firenumber is zero, before I extinguish a fire, if I understanded your question right.

Last edited by hopfel; 01/24/10 18:57.

Hilf mir, dir zu helfen!
Re: It does what it likes -.- [Re: hopfel] #306795
01/25/10 00:04
01/25/10 00:04
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

A few questions

How many players are putting the fire out?

Is this the situation?
Quote:

You have 5 fires
You have to put water on them

firenumber is 0 when your start
code to repeat this action until firenumber is 5
the fire is on
put water on this fire
firenumber is +1
fire is out
repeat


You will have to give us some code to work with.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1