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 / Reading from file problem

Author
Message
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th Jan 2011 20:04 Edited at: 8th Jan 2011 20:06
Hi!

Maybe this should be in newcomers chat, but doh .

I wrote a simply code, that displays textured matrix, and a tower. Additionaly i wanted to control my camera freely, and make some cut-scenes. So, i made code for writer, which simply writes my every move to a file, and a reader, which reads it. The problem is that when i try to read the code, and then move my camera by the readen coords, it won't move.

That's the whole code:




I can use goSub cam_mov to read my coords, and move camera, and when it's not there, then it will register my movements.

Cheers!

~Kamac
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th Jan 2011 22:03
@BUMP

Please, i need help

Cheers!

~Kamac
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Jan 2011 23:20
OPEN TO WRITE will fail silently when the file already exists, and all writes to that file will then also fail.

Could that be the problem?

Also, why are you doing this:


Why not just do this:

(There was also an error in there that I've removed).

kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 9th Jan 2011 09:44 Edited at: 9th Jan 2011 09:54
I was using this



Instead of this:



Because i tried already



and thought it might 'cause the problems so i switched to that more complicated. One second, i'll check if that's working.


Edit@

No, i think that isn't the problem, the write file, because my app actually writes all the coords, it cannot then read them from the file and move the camera. So still, it won't work.


Edit2@

Success .

The problem was that i used ex. position camera X#,Y#,Z# while i was seeing camera number one. So i changed it to position camera 1,X#,Y#,Z# and all works . Thanks for help

Cheers!

~Kamac
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Jan 2011 12:45
Doh, should have seen that.

So why exactly are you creating a second camera? Why not just use the default one?

As it is, you are rendering twice (even if you only see one camera), which is twice as often (and as long) as you need.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jan 2011 13:23
Yes, that seems to be a common error recently. I wonder who started it?

Perhaps some people think they need to create a camera before they can see anything? But again, why I have I only seen that in recent months?
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 9th Jan 2011 18:25
Nah, i used that other camera, because of ... dunno why, i just created it and used it . I know i don't have to make one, but anyway .

Cheers!

~Kamac

Login to post a reply

Server time is: 2026-07-21 20:36:11
Your offset time is: 2026-07-21 20:36:11