Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / noob needs help, not sure why im missing this!!!

Author
Message
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 23rd Oct 2005 04:57
pardon the messy code, I am trying to work out somethings with a battle system for a rpg sytle game and the problem is: object #2 will not flag the attack variable....

appreciate any help

Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 23rd Oct 2005 13:05 Edited at: 23rd Oct 2005 13:05
This line in your loop:

if d#<12 then attack=1 else attack=0
will change attack to 1 when a object in range, but when an object not in range it will turn it back to 0.
So the attack for object 4 will work 'cus 4 is the last object in the loop.
If 2 or 3 in range attack will change to 1 but if 4 not in range then attack will be reset to 0 before returning.

Try putting attack=0 at the begining of the sub-routine just before the for-next loop and change
if d#<12 then attack=1 else attack=0
to
if d#<12 then attack=1


The word "Gullible" cannot be found in any English Dictionary.
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 23rd Oct 2005 20:32 Edited at: 23rd Oct 2005 21:22
So far what I gather is that even though the other objects are checking for distance to the player, they (not being the last object in the loop) will not set off the attack flag...

hmmm, need to rethink this one... Thanks

edit: Ok, i got what I needed by building another loop to check distance and attack, seems it was not possible with the exsisting distance check loop the way it was structured...

Login to post a reply

Server time is: 2024-09-24 07:33:34
Your offset time is: 2024-09-24 07:33:34