Unknown variable floor_tex on Gamemaker 8.1. How to fix it? - game-maker

I have a very trouble with Gamemaker 8.1.
So recently, I've followed this video tutorial which shows creating a game 3D on its game engine.
https://www.youtube.com/watch?v=0Jo0JEEukhc
I tried to test my game, but an error message shows
this.
What caused that error? Here is the code so I hope you can fix it as well.
direction -= (display_mouse_get_x() -(display_get_width()/2))/5
zto -= (display_mouse_get_y() -(display_get_height()/2))/2
display_mouse_set(display_get_width()/2,display_get_height()/2)
xto = lengthdir_x(100,direction)+x
yto = lengthdir_y(100,direction)+y
d3d_set_projection(x,y,z,xto,yto,zto,0,0,1)
draw_set_color(c_white)
d3d_draw_floor(0,0,0,room_width,room_height,0,background_get_texture(floor_tex),room_width/128,room_height/128)
d3d_draw_floor(0,0,100,room_width,room_height,100,background_get_texture(root_tex),room_width/128,room_height/128)
Also, the version of Gamemaker is 8.1.141 (r11549)
Thanks
Cheers
-Sajad Sadiq Abd Amhamad

In the video, the author creates two Background resources around 0:25, called floor_tex and roof_tex (mistyped as root_tex in your code). You'd want to either name your resources accordingly or adjust your code to match the names in your project.

Related

AzerothCore: set creature MovementType 1 does not make it random move

Yesterday I compiled AzerothCore, by following the step by step guide. I have a working server so decided to make some small edits, just to test.
I am using https://github.com/BAndysc/WoWDatabaseEditor/blob/master/README.md to edit the database.
I'm trying to make Argent Commander have random movement with the code below this post, but somehow they do not start moving. Any guess where i'm wrong at?
Note: Argent Commander should not have random movement, just doing this as a test.
UPDATE `creature_template` SET `MovementType` = 1 WHERE `entry` = 37965;
you have to also set wander_distance for the npc in creature table
https://www.azerothcore.org/wiki/creature#wander_distance
Sadly you can't do that yet in the wow db editor editor

Why is QLineWidth not taken into account?

In Qt3D certain properties of rendered objects are not just simply set on the renderer, but they are globally (per view) or locally (on the material of a rendered object) added to the renderPasses - or so is my comprehension at least. (I'm using PySide2 - but the code is almost the same in C++)
For example when adding a geometry-renderer and using its primitive type point (Qt3DRender.QGeometryRenderer.Point) instead of rendering triangle-faces it displays the points of the geometry.
Here is an example figure with the default type.
The same only showing the points (renderer.setPrimitiveType(Qt3DRender.QGeometryRenderer.Points))
Hard to guess, but here the point-size has been already been changed - using the following code:
material = Qt3DExtras.QPhongMaterial(e)
for t in material.effect().techniques():
for rp in t.renderPasses():
pointSize = Qt3DRender.QPointSize(rp)
pointSize.setSizeMode(Qt3DRender.QPointSize.SizeMode.Fixed)
pointSize.setValue(5.0)
rp.addRenderState(pointSize)
According to the documentation the same mechanism can be used to change the line-width when rendering the object with Lines (LineStrip) as primitive type. Adding
lineWidth = Qt3DRender.QLineWidth(rp)
lineWidth.setValue(5.)
lineWidth.setSmooth(True)
rp.addRenderState(lineWidth)
does not change the line-width.
Why? Where do I need to add QLineWidth? Is it the material I chose which ignores the QLineWidth-state?
I'm fighting with similar problems at the moment. I tried to reproduce the behaviour with Qt3D line width test. When setting format version to 4.6 with CoreProfile, the maximum of linewidth seems to be 1 (or equivalently width=3 displayed by the line test).
It might be possible that this is the maximum supported range.
See:
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glLineWidth.xhtml
opengl glLineWidth() doesn't change size of lines
Note: I deliberately chose version 4.6 as that is the supported openGL version on my environment.
I ran into the same issue. It appears the problem is caused by Qt3DExtras::Qt3DWindow, which constructs a QSurfaceFormat with an OpenGL core profile. The glLineWidth function is not supported in the core profile.
Unfortunately there is no way to pass a QSurfaceFormat to Qt3DWindow. Setting a new format after the window is created also does not work.
The only way around this is to write your own window class with a QSurfaceFormat in compatibility mode. For example:
setSurfaceType(QSurface::OpenGLSurface);
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
format.setVersion(4, 3);
format.setProfile(QSurfaceFormat::CompatibilityProfile);
format.setDepthBufferSize(24);
format.setSamples(4);
format.setStencilBufferSize(8);
setFormat(format);
QSurfaceFormat::setDefaultFormat(format);
Fortunately Qt3DExtras::Qt3DWindow does not actually contain a lot of functionality and you can easily write a similar class with the QSurfaceFormat changes mentioned above.
You can find the original source here for reference:
https://code.woboq.org/qt5/qt3d/src/extras/defaults/qt3dwindow.cpp.html

Qt OpenCV write video from capture frame, not saving

I can succesfully save video which I captured from c++ opencv there is no problem.
Bu similar code not capturing the video. Just opening out.avi . and only 6 kb.
I put the code in showframe func. there is no resizing fyi.
Anybody has experience with the opencv videowriter on the Qt?
void Widget::show_frame(Mat &image)
{
Mat resized_image = image.clone();
video.write(image);
int width_of_label = ui->label_camera->width();
int height_of_label = ui->label_camera->height();
Size size(width_of_label, height_of_label);
// cv::resize(image, resized_image, size);
cvtColor(image,image,CV_BGR2RGB);
cvtColor(resized_image, resized_image, CV_BGR2RGB);
ps : Platform MacOSX
I encountered the same problem with you, and I have tried many solutions, I think you can make the fifth parameter of videowriter() be false. That is, VideoWriter out = VideoWriter(video_name, CV_FOURCC('D', 'I', 'V', 'X'),frame_fps,Size(frame_width,frame_height),false). This works for me!
make sure that your application has access to the opencv_ffmpeg*.dll. For example place it in the working directory or the PATH variable.
Try different codecs, too. Afaik, MJPG did work on all tested machines/systems so far.

How to make use of KPixmapSequence on KDE Frameworks 5

On KDE4/Qt4 days KPixmapSequence("process-working", KIconLoader::SizeSmallMedium); would successfully load and show the process-working image, trying to port that to KDE Frameworks 5 that no longer works.
Any idea on how to make it work again? Does it have anything to do with Breeze theme using a SVG instead of PNG that Oxygen used?
It seems that one needs KIconLoader to make it work:
auto seq = new KPixmapSequence;
seq->setSequence(
KIconLoader::global()->loadPixmapSequence(
QLatin1String("process-working"), KIconLoader::SizeSmallMedium));

OpenCV + Qt + cv::mat::deallocate and cv::fastFree(void *) memory problems

I've got two error messages:
cv::mat::deallocate
cv::fastFree(void *)
While I was trying to compile my OpenCV and QT project. I am fighting with this problem for fifth day. Please guys if you know how I can solve this problem, write it here.
PS: I've uploaded an image.
http://postimg.org/image/wsyq8daf5/
After this day, my problem with the camera was totally solved.There are no more problems.Now i will continue my GUI project thanks to all of you guys.After 1-2 months i will start searching for how to write printer driver ;), but however.Thanks too all again. ;)
Finally i solved my problem using the QCamera class.Well guys, use QCamera, you don't need anything else to capture videos or images.Read everything about it and bye bye ;)

Resources