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 / This is very strange

Author
Message
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 21st May 2008 17:32
Hi, i have encountered a very strange problem. When i am going to build the final build for my, you can start the game and play it as usuall. BUT, i cannot press escape to quit the game and when i'm dead, the game is supposed to end when the player press any key, though this does not work either.

When i press F4 the game ends but it's still a process in the task manager. How do i fix this very annying problem?

Thanks in advance // Nackidno

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 21st May 2008 17:57 Edited at: 21st May 2008 17:59
add this into your loop

if inkey() then end

that will check if the user has pressed a key and if they have it will end the game.

or if you want it to wait for the player to press the key add

wait key `stops the code from executing until the player presses a key
end `ends the game

nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 21st May 2008 18:04
This is the ode for quiting the game after dying :



Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 21st May 2008 18:30
I use no DLLs, plug ins ect. It's all clean Dark basic Pro.

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 21st May 2008 19:17
I do not understand it if I do not watch all the codes.
Do you do the post?
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 21st May 2008 19:55 Edited at: 21st May 2008 20:01
I don't think it's really necessary to post the whole code since someone may steal it from me.

And it's me that posts yes, why?

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st May 2008 20:25
you could try using a close program function like so



plus stick it at the end of all your code then it bound to stop and end.

Dark Physics makes any hot drink go cold.
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 21st May 2008 20:32 Edited at: 21st May 2008 20:32
Git it working, it had to do that i changed the name of the application

Off to announcement!

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 21st May 2008 22:15
Another strange thing has occured. When i print score text on the screen, the text seem to fall down the left side of the screen, and creates a black area in the lower part of the screen.

All i have written is :

Print score

after the sync in my loop, since putting it elsewhere makes it now showing up.

Thanks in advance, and sorry for so many questions.

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 22nd May 2008 04:51 Edited at: 22nd May 2008 04:55
You can use set cursor 0, 0, or wherever you want to score to be.
Alternatively, you can use the text function to place it where you want.
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 22nd May 2008 08:15
I have used the set cursor command. And the text command doesn't work with variables it seems.

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 22nd May 2008 09:18 Edited at: 22nd May 2008 09:20
sync will wipe out the effect of set cursor.

I suppose that leaves us at somewhat of an impasse, since you fear that your code will be stolen if you post it.

I would, however advise you to move it back before the sync. Sync should be the last thing in the game loop if you want to maintain rigid control of your display each frame.

text will work with strings...use str$ to create the string.
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 22nd May 2008 18:12
Thanks Jinzai, just got it working. Thanks you very much!

Footsteps W.I.P
Trala'em Goes Oblivion (TES IV Mod)
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 23rd May 2008 20:13 Edited at: 23rd May 2008 20:49
Can a mod please rename this thread to : Nakidnos thread of problems?

That's right, another problem. Instead of making more threads, i'll stick to this one.

Now to the problem, i am stuck when i'm trying to output text on the 2D screen. I use the set cursor command and the print command, but nothing happens.

My code looks like this (And this is the whole code) :



Can someone please help me? Sorry for asking so many questions in so few days.

EDIT : Ok, i putted the set cursor and print inside a do-loop. That fixed the problem slightly, though i cannot output the text upon a sprite. What should i do to fix this problem? Please help me.

The code looks like this now :



- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 23rd May 2008 20:49 Edited at: 23rd May 2008 20:50
I was going to lobby the Mods to sticky it with the original title.

Why apologize for asking a question? I'm always curious about that, because its not usually the question that matters, but the way that it is asked and how it is responded to that matter to me, at least.

About your code, it is creating a snapshot, and then waiting. While it is waiting, it redraws the screen. If you want it to print text over the sprites, you must create a loop that prints the text for you. The sprites will be drawn automatically, but text will not. In the do/loop you establish your print code to draw a page over the sprites. You want the text to be drawn last, so you make the draw sprites first call to ensure that you are in control of the drawing order.

Your code also does not address sync, and you are getting the default, which is not an issue at this point. Its just another topic for this thread when you want to use it.



I only changed what I thought necessary.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 23rd May 2008 20:52
Add the draw sprites first call before the loop.
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 23rd May 2008 20:56
Thanks very much Jinzai it works just as it should now.

About the thing of apologize for many questions : In many other forums, people seem to dislike too many questions. So i guess it has become a bad habit.

Is do-loop the "main" loop used in a program? Many guys i have asked seem to only use do-loops.

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 23rd May 2008 21:04
Yes, that is the usual format. Its equal to one frame in the game, or application. DBPro/GDK and really any game programming system, including just using DirectX in Windows is arranged in a very similar fashion. Even a bare Windows program consists largely of one event driven loop called a message pump.

I have visited some of those forums you are referring to, but...not usually more than once. Knowledge is an interesting commodity; some people cannot detach ego and greed from its use. I don't think it should come at any particular cost, beyond the usual hard work and patience required by anything else you might do with your time.
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 23rd May 2008 21:27
Man, nothing works as it should!

I can't see the question asked when using the input command! I can only see the answer i give while typing, but not afterwards?
Please help me out with this and i will be most grateful!

Code so far :



If my quess is right it has to do with the sync, right?

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 23rd May 2008 21:52 Edited at: 23rd May 2008 22:10
Yes and no. Read the help file for input, paying particular attention to the last sentence:
Quote: "This command only prints the prefix text once, so combining
this command with a 3D backdrop is not recommended."


It is not intended to be used in this way, so you'd be back to having to use the snapshot code that you tried to begin with.

Here is your code, but the input part is done in the snapshot manner, then the sprite thing happens.

nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 23rd May 2008 22:36
Ok, but that asks the question before the game has "started". I want the name input question asked in the text area (Shown on the screen attached)

Hope this will clear things up a bit.

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/

Attachments

Login to view attachments
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 27th May 2008 19:28
How do i change the scene from 3d to 2d and reverse?

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 27th May 2008 22:23
Ok, i'll try. But i cannot print integers and real numbers with the string command. How am i supposed to do when i come to it when i'm supposed to print an integer variable on the screen?

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 28th May 2008 06:40
Yes, i know that very well. But, when i'm going to print an integer or real number on the screen, i don't know how to do that, since i must use it later one.

Quote: "Look into TEXT and ENTRY$ commands. (if you need help: Try putting 'TEXT 200,300,ENTRY$(1)' in your main loop and see what happens)"


Well, i got an error message

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th May 2008 07:41 Edited at: 28th May 2008 23:47
Quote: "when i'm going to print an integer or real number on the screen, i don't know how to do that"


Print VariableName

..will print the contents of the variable regardless of the variable's type.

However, as has already been said, the Text command is much better to use as it also has X/Y positioning on the screen built-in.

The only thing is that unlike Print, the Text command cannot print numeric variables as it is only for strings. So, you use Str$() which converts any numeric variable to a string.

As such, you can use any of these:

Text 100,100,Str$(MyIntVariable)
Text 100,100,Str$(MyFloatVariable) < If variable has been declared as float
Text 100,100,Str$(MyFloatVariable#)

TDK_Man

nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 28th May 2008 17:11
Parameter mismatch in expression 'entry$'.

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th May 2008 23:54
As for switching between 2D and 3D, look at the Set Camera View command if you are not already using it.

TDK_Man

nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 28th Jun 2008 17:55 Edited at: 28th Jun 2008 18:02
Long time no see (In this topic).


I have another problem here now, I am supposed to open the inventory screen when the I key(23) is pressed. Now the inventory shows up and such BUT, it dominates the top layer of all sprites, why is that, and how do I prevent it?

By dominating the top layer, I mean the image loaded after pressing I key is showed upon all other images, even the cursor(Custom).

Any idea how to fix this, many thanks in advance.

EDIT : Wait, I got it working, I rewritten some parts.

I loaded sprites from images
Hide all sprites
When key pressed, show decided sprite.

Is there any better way to do this since this doesn't really feel right.


//Nackidno

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 28th Jun 2008 23:00
Oh, I didn't see that command Thank you.

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Jun 2008 23:25 Edited at: 28th Jun 2008 23:26
Another way to do it is to hide the normal sprites using HIDE SPRITE and use PASTE SPRITE to paste them just like an image. That way I can write text over them . Or was this the way you felt wasn't right?

ex.


Or they could be drawn in the loop if you wanted to change the image (warning flashing sprites):



nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 29th Jun 2008 01:08
Thanks 60[], I appreciate that!

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 5th Jul 2008 11:51
I got another problem. I'm trying to show the current FPS on the upper left corner of the screen. But it always show me 0...

My FPS code :



- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 5th Jul 2008 12:59
Thanks!

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 11th Jul 2008 21:38
I am having another problem. I am trying to make an event-like thing in my game, when you walkm into a certain object, some actions are executed and the object is beeing deleted. But the object can't be deleted!

When I walk into the object it says that object at line 74 does not exist! What am I doing wrong?

My code:


Can someone please help me?

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 11th Jul 2008 23:41
Sorry, I finally figured it out. No more need for help...Until later...

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 12th Jul 2008 00:07
Good god. I have another problem. I'm trying to show text on the screen for a certain amount of time, but it's not working! The game stops for 3 seconds (As it should), but my text is not showed?

My code :



- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 12th Jul 2008 23:21
I have tried insanely many times.

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/

Login to post a reply

Server time is: 2024-09-27 18:16:27
Your offset time is: 2024-09-27 18:16:27