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 Professional Discussion / Both user defined type values must use the same type?

Author
Message
Mugen Wizardry
User Banned
Posted: 9th Aug 2010 17:47
Ok all. I rewrote my ENTIRE project. Now I'm getting a weird glitch as the title says.



And yes, I did try before asking for help.

Thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Aug 2010 17:58
Your using a typed array, but aren't referencing the element, like this line here:

Object(playerid)=find free object()

You should specify '.ID' perhaps:

Object(playerid).ID=find free object()

Health, Ammo, and bacon and eggs!
Mugen Wizardry
User Banned
Posted: 9th Aug 2010 18:04
thanks, vanB.

Ok, I'm having one more small problem.

It's saying: 'Object already exists at line 113'



thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2010 18:30
Also, from a software engineering standpoint, you could make your code a lot better by only using a single type. 'player' and 'enemy' are exactly the same, and when you think about it, an enemy is a player anyway, and is controlled in all the exact same ways, except for the AI layer. You should use only one type and just make a boolean flag inside saying whether it's a good guy or a bad guy.

"everyone forgets a semi-colon sometimes." - Phaelax
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Aug 2010 18:40
I think your getting that error because you arent doing anything with the object, so if you call FIND FREE OBJECT twice, you get the same object number. Probably best to set the object ID's and image ID's just before loading them in, so that ID get's used up.

Health, Ammo, and bacon and eggs!

Login to post a reply

Server time is: 2026-07-24 20:35:17
Your offset time is: 2026-07-24 20:35:17