Community
Message Board

Chat room - users
Game Over
( 394431 downloads)
Work In Progress
( 523201 downloads)
Links

Code Exchange
Downloads
Tutorials
Add to Favourites

Submit news

DIV ARENA FORUMS
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: An oldie but a goodie: recording the screen!
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


info.gif posted on 9-6-2016 at 05:07 PM
An oldie but a goodie: recording the screen!


Hello all, hello hello hello.

So I've seen this done a million times in DIV games before, and I'm sure you all have as well :) Where ingame, there's a TV screen or a display of some kind which shows exactly what the player's looking at, using the screen_get function.

I've got it working just fine in CyberCrisis at present, except that every now and again, it causes a random crash - the game will quit and I'll get the "blabla has encountered a problem and needs to close" Windows box pop up.

Before the loop/just after the Begin, I have this code:

displayscreen_graph=map_new(73, 55, 16);
playersscreen_graph=screen_get();
map_xput(0, displayscreen_graph, playersscreen_graph, 36, 27, 0, 15, 0);
graph=displayscreen_graph;

and then in the main process loop, this code:

playersscreen_graph=screen_get(); // Crash
map_xput(0, displayscreen_graph, playersscreen_graph, 36, 27, 0, 15, 0);
graph=displayscreen_graph;
Frame;

For some reason, the line I've commented with "Crash" makes the game, well, crash. Commenting it out/removing it and running the game works just fine (except the screen doesn't update beyond the first frame of course).

As it's been done so frequently in DIV projects, I wanted to ask if anyone here had any experience with it, any why this might be crashing the game?

The game's very near completion and it's a blast to play, I'm sure you'll enjoy it when it's done :)


~ BreadyTits




~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
dom cook
Div Pro
******




Posts: 372
Registered: 4-3-2016
Member Is Offline


[*] posted on 9-6-2016 at 06:35 PM


It looks to me like DIV doesn't recognise this screen_get() function.
It's got a screen_copy() function which might help..
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 9-6-2016 at 06:47 PM


hmm, it must be one of the thing's that's different in Bennu to Div then, as I'm coding in Bennu. There isn't a screen_copy function in Bennu, it seems, but it does have screen_get(), which just returns a screencap at the screens present size. Hm. Maybe I'll need to go to the Bennu forums for assistance then :p



~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 9-6-2016 at 06:47 PM



In div this is as simple as calling screen_copy. not sure where screen_get comes from
Code:
screen_copy(<region>, <file>, <graphic>, <x>, <y>, <width>, <height>)

Always worked well in DIV. I doubt anybody can give you any pointers.

Sounds more like a bug in whatever it is you are using, which is a shame.

[Edited on 9-6-2016 by MikeDX]
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 9-6-2016 at 07:04 PM


Right, I've gone over to the Bennu forum to ask them about it :) Other people do seem to be using it, just not in the same capacity as I am, so someone'll likely know something.

I doubt porting CyberCrisis to DivDX where the screen_copy function works would be plausible sadly, as it's all 16 bit and relies heavily on additive blending. :/




~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 9-6-2016 at 08:20 PM


DIV wont be 8bit forever. At some point I will actually get around to upgrading the whole system. We're getting closer now with all the bugs being nailed and the platform becoming stable.

The only bottleneck now for me is time - need to do a lot of work to get everything to work as it should, which means the editor has to go 32bit. The rest is all good to go. Only graphically is DIV retarded now.
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 10-6-2016 at 02:58 PM


Phew, got it fixed. Turns out that screen_get loads into the system memory, so you need to UNload it after every use, haha. Done and done :)



~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 11-6-2016 at 03:53 PM


Ah that makes sense

So, we might be supporting the bennu 32bit fpg format soon, would make returning to the DIV stable a bit easier ;)
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 15-6-2016 at 01:50 PM


Quote: Originally posted by MikeDX  

So, we might be supporting the bennu 32bit fpg format soon, would make returning to the DIV stable a bit easier ;)


Brilliance! All I'd need then is a Mode 8 map editor with a few features like copy paste & selection boxes for multiple vertices, and possibly for it to not crash every other time I right click... or to randomly make undeletable vertices and sectors which crash the program and corrupt the .wld file... haha. But a 32bit FPG format would be great :)




~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 15-6-2016 at 02:18 PM


Are you getting wld editor crashes? I Have had mixed results.. trying to iron all the bugs out but it just takes a lot of time and testing. Reproducible bugs would be good.

Having the ability to copy / delete sectors is something I'd look at for future stuff though, it can be quite tedious to do anything complex.

Also I'd like to be able to generate a 3D world purely in code with an add sector/line/point set of commands (we already have the height/texture stuff done).. Then people could make their own editors.
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 15-6-2016 at 02:46 PM


Right clicking often causes the editor to crash, on windows 8 at least. Occasionally when making lots of smaller sectors for things like little pools of blood or rock formations, I end up with one bad sector that ends up being unselectable, so I can't delete it - and when you attempt to view it in program, it crashes DIV entirely.

Selection boxes and copy paste would be so powerful - you've made a room too small? fine, just click and drag to make a selection box, select all the vertices of the top of the sector, then pull them all upward at the same time, allowing for easy and effortless manual expansion of the sector, or sectors. Hm, it's still looking a little barren... I know! Let's copy that "crate" sector from another part of the map... hit paste three times, then position the three new crates where I want them. There! (An ability to rotate a sector with all it's vertices moving at the same time would be good for this, too. You could turn them on their axis.)

All just ideas to make the editor more friendly and encourage further use, of course :)




~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User

  Go To Top

Powered by XMB
XMB Forum Software © 2001-2012 The XMB Group
[Queries: 18]