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 / Weird code crashes my computer

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Jun 2009 16:29 Edited at: 11th Jun 2009 16:48
Hello!

So, EVERY TIME this section of my code comes, my computer crashes. Why? This is very frustrating!!!

Code:


And yes, the Collision DLL is in the same directory and the function exists and I have declared the array "s()".

Anyone that can solve this problem will get a home-made cookie.

TheComet


Make the path of your enemies easier with Waypoint Pro!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Jun 2009 23:26
For

try changing 70 to 70.0 and see if it makes a difference.


bubble.x could be a malformatted X file.

Can you attach that X file, or do you want to keep it private? If you want to keep it private, look through it towards the end and see if there is something that looks similar to:



Often a badly formatted animation set will cause a crash.
But there are many other things so posting the entire file would track that down.

Also, if the x file uses a texture, check for a template like:



After TextureFileName, there should be the name of the texture and it should be a .bmp file. Any other type may not sit well with DarkBASIC. Also, if you have MS Paint - yes MS pain specifically, often you .bmp file in it and then just save it. This will guarantee that the .bmp is formatted properly. Some high end graphics editing programs have a lot of options for outputting a .bmp file and the result may not be a pure Windows DIB which DirectX 7 can't deal with.

I'm just guessing the X file is your problem. Could your code
t=4 to bubbles+3
be that bubbles is way too high or way to low out of the range of object number?

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th Jun 2009 23:02 Edited at: 18th Jun 2009 23:06
Sorry it took me so long to answer, no, it is not private. I uploaded the model + texture (attachment). I need a professional to look at it for me.

I tried changing 70 to a float, but it still crashed. I think it is the model, or the collision dll.

TheComet


Make the path of your enemies easier with Waypoint Pro!

Attachments

Login to view attachments
Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Jun 2009 23:05
Quote: "I uploaded the model + texture (attachment). "


I think you forgot the attachment

<-- Spell based team dueling game!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th Jun 2009 23:07
Well, so I have... Post edited, thanks sixty []

TheComet


Make the path of your enemies easier with Waypoint Pro!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Jun 2009 02:32
Quote: "if IntersectObjectDBC(1,0,x#,100.0,z#,x#,-100.0,z#,t)!0 "


Can DB use the exclamation mark? Any other language would be != in that situation, DB's inequality sign is <>

[url="http://dbcc.zimnox.com"][/url]
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Jun 2009 09:26
Yes, it can. At least this code here runs:



TheComet


Make the path of your enemies easier with Waypoint Pro!
t10dimensional
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 19th Jun 2009 10:11
whats the "!" mean?I did'nt know about it.

If at first you don't succeed-Pause-Go to last checkpoint
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Jun 2009 12:19
I don't think it's the x file. That looks pretty straight forward except it's missing a Header { template.

After
xof 0302txt 0064
Try adding
Header {
1;
0;
1;
}
in the x file.

But wait. I think I just noticed something in your code:

IntersectObjectDBC(1,0,x#,100.0,z#,x#,-100.0,z#,t)

Lets see, I can't remember the parameters off hand but that 't' at the end. Isn't that the object to exclude from detection? If 't' is a new object that you are loading right before testing for collision, it has to be setup for collision in Sparky's before you can test it or else it doesn't exist in memory for the collision dll.

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Jun 2009 13:41
@razer
! = not

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 19th Jun 2009 16:33
if I recall correctly the ! is a binary operator and as obese said it means not

so :

81 ! 102

1010001 ! 1100110 = 0010001 = 33

i think, someone check me on that

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jun 2009 00:23 Edited at: 20th Jun 2009 00:26
In DBC pronounce ! as "Not the same as" just to differenciate it from <> "Not equal to"; but the function is the same except faster. It only returns a 1 or 0 for true or false.

a=5543
b=3532

a ! b = 1

a=5
b=5

a ! b = 0

@TheComet
Make sure you read through the whole thread because I think I may have tracked down the problem a couple of posts up. You'll have to test it to be sure.

Enjoy your day.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 20th Jun 2009 00:50
o, how is that different from <> then?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jun 2009 01:11
Quote: "but the function is the same except faster. "


Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Jun 2009 10:24
And to be precise, 6 times faster.


Make the path of your enemies easier with Waypoint Pro!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jun 2009 10:49
@TheComet
Was the problem not setting up the collision for the newly loaded t objects as I posted a few posts above? I'm curious

Enjoy your day.
Bluestar4
18
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 20th Jun 2009 13:32
Quote: "o, how is that different from <> then?"


! is "not" and is a boolean. it evaluates whether a condition is false, whereas <> evaluates by logically or by math

bluestar4~
---Missle Might - Hero Battles - Zillipede --- which do you like the best ?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jun 2009 18:32
Hi Bluestar,

It seems like it should be NOT but in DBC it is "Not the same as". It can only be used as a comparison between two expressions. It can't be used in a single false evaluation. This will not work:

a=5

If ! a then etc.

However if you put an expression on either side:

If a ! 5 then etc.

it will work.

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Jun 2009 20:53
I finally got around to testing it, and yes, it was the "t". Thanks Latch and everyone that helped me out!

TheComet


Make the path of your enemies easier with Waypoint Pro!
Bluestar4
18
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 20th Jun 2009 21:34
yes correct latch .

bluestar4~
---Missle Might - Hero Battles - Zillipede --- which do you like the best ?
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Jun 2009 03:59
Is...
if ! a
the same as...
if a = 0

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Jun 2009 10:59 Edited at: 25th Jun 2009 11:00
That expression doesn't work in DBC. In a language like C for instance, you can check the validity of an entire function or other expression that way



So calling
if !a would just cause DBC to complain and hault execution

But yes. To be a false statement a=0.

Enjoy your day.
Bluestar4
18
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 25th Jun 2009 13:20 Edited at: 25th Jun 2009 13:25
as latch details , the exspression ! evaluates true if the return of a function,vairable,or expression is false or 0.

so in c+

in all the cases the if statements will execute. Hope this explains it better.

bluestar4~
---Missle Might - Hero Battles - Zillipede --- which do you like the best ?
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jun 2009 17:31
thats right, its a not operator, meaning:

! (true) = false

! (false) = true


but that doesnt work in DBC

There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Jun 2009 12:55 Edited at: 26th Jun 2009 12:56
are there any other logic operators besides AND, OR and NOT?
(That can be used in DBC or DBP; please specify if they only work in one)

TGC Forum - converting error messages into sarcasm since 2002.

Login to post a reply

Server time is: 2024-05-20 09:17:28
Your offset time is: 2024-05-20 09:17:28