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.

DarkBASIC Discussion / Bug with object exist() ?

Author
Message
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 7th Dec 2003 21:25
Ive coded this piece for my game DarkTimes, but I get the error "Line 1486, object does not exist" wtf is wrong???

Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 7th Dec 2003 21:26
<where is the edit button?>

btw, line 1486 =
distance#(z)=sqrt( (abs(object position x(z) - object position x(target(z)))^2) + (abs(object position z(z) - object position z(target(z)))^2) )
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 7th Dec 2003 22:07
First of all, you don't need the abs() functions inside the distance formula. When the number is squared it automatically makes it positive.

The answer:

What is object z? In other words, you have object position x(z) and object position z(z). You have verified that object exist(target(z)), but you also need to verify that object exist(z). You must also put me all of your code that involves your objects inside of your if then else endif for those objects.Here is the edited code:



Hope I helped, good luck (I ignored the second part of your code, I will help with that too if it doesn't work)

Xander - Bolt Software

Why do the antagonists always have to look so cool?
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 7th Dec 2003 23:30
Im gonna rewrite the whole code, your code works, but I experience big slowdowns and a 30FPS loss?
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 7th Dec 2003 23:49


I am mischeivious
RoooooOoooooKoooooKoooooRoooooOoooooKoooooKooooo!
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 8th Dec 2003 00:23 Edited at: 8th Dec 2003 02:06
Bolt,

Your code works excellent, ive rebooted my pc, and the slowdowns and bad framerates were gone (maybe kazaa was the problem..)

Thanks for helping me, ye'll be in the credits screen

Login to post a reply

Server time is: 2025-05-22 05:49:52
Your offset time is: 2025-05-22 05:49:52