GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Re: GML Reference » Primitive Bug (GM6) » 2008-06-30 07:12:18

*a number of crashes later...*
Well, it seems I've jumped the gun here. I can't seem to replicate it in a new, identical project file, but the original project file still does it.
http://host-a.net/tarkimos/bad_primitive.gm6
Password is 'xot' (I don't want anyone downloading without knowing what it is, just in case it hurts their computer sad).
(Username is 'tarkimos'.)

#2 GML Reference » Primitive Bug (GM6) » 2008-06-29 00:45:17

$pecter
Replies: 3

Okay, well it's pretty obvious that you shouldn't try to draw 'triangle-based' primitives (eg. pr_trianglelist, pr_trianglestrip, etc.) with less than three points because nothing will be drawn (trying to draw a triangle with two points draws nothing). When trying to draw a triangle with one point one would expect nothing to be drawn (just as with two points). But instead, it causes a BSOD (I'm guessing that draw_line_width_color uses triangle primitives also).

I've only tested with pr_trianglestrip and pr_trianglefan, but I'd expect pr_trianglelist to act similarly.

#3 Re: GML Reference » draw_surface » 2008-03-18 01:44:31

The draw_surface() function and its many draw_surface_*() brethren are unaffected by the use of draw_set_alpha().

As are draw_sprite, draw_background, etc.

draw_set_alpha(alpha) Sets the alpha transparency value to be used from now on for drawing primitives.

#4 Script Alumni » bin_to_bytes, Error » 2008-02-25 05:27:36

$pecter
Replies: 1

In the script bin_to_bytes the variable out just 'appears' on the 4th last line and isn't initialized anywhere else.
Error?

#5 Re: GML Code Help » BMP Format » 2008-02-25 01:15:42

Thanks xot, that works. I think I better read up on bitwise operations now.

PS. Sorry for the inconvenience of uploading the .gm6 and making you supply your own .bmp. I meant to upload a .zip. whistle

NEW QUESTION
Now, with my previous code, I'm trying to encode some text into the 'unused' alpha 'channel' of the bmp.
I can't get it to save/load (I can't tell)!
This is what I've got so far.

#6 Re: GML Code Help » BMP Format » 2008-02-24 02:53:53

For one, that's not how little-endian 32-bit integers work.  You can't just add the byte values together.  Just like how 1111 doesn't have the value "4".  You're completely ignoring place value.

Wow, it was some extreme co-incidence that it worked on that image.
Now I'm confused...
So I would do it like this?

repeat(4)
    width+=string(file_bin_read_byte(file));
width=bin_to_dec(bytes_to_bin(width));

#7 GML Code Help » BMP Format » 2008-02-23 19:31:26

$pecter
Replies: 4

I'm trying to develop a script for loading the contents of a .BMP file into an array, and a script to save them back into a .bmp.
I can load alright, but the file always becomes unusable when I save.
A .zip of the source file and an image is located here.
Does anyone know what I'm doing wrong? Or does anybody have a working script?

NOTE: I know I'm not utilizing a lot of the header data, but I'm just trying to get the basic working before I go further.

#8 Re: Community » Introductions » 2008-01-19 19:51:55

Hi, I'm Josh. I commonly go under the display name of $pecter (or tarkimos on sites that do not allow '$').

I've matured quite a bit since I started using GameMaker 5.x in late 2003 (as my earlier posts on the GMC will demonstrate). My 'game making' skills have also increased greatly although there are some aspects (multiplayer) I still haven't tried. Steadily, I've been getting more generous towards the GMC. Answering questions and making examples is somehow more interesting than actually making a game now. And for the record I don't like playing games (I got Half-life 2 ages ago and still haven't finished it).

Off computers;
I like a lot of sports particularly football (soccer), [field] hockey, and most of all, competitive swimming (as my trophy shelves demonstrate smile ).
I live in Australia and like all Australians; I ride kangaroos to work.

#9 Re: Off Topic » People expect credit for a damnedest things. » 2008-01-19 19:14:13

Maybe he only just learned that at school? I've seen worse.

I'm sure there are still people running around on the GMC thinking that their

Expanddraw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);

is 'God's gift to game making!'
or that combining a few functions counts as a script.
eg.

Expand//draw_set_everything(color,alpha,font,halign,valign)
draw_set_color(argument0);
draw_set_alpha(argument1);
draw_set_font(argument2);
draw_set_halign(argument3);
draw_set_valign(argument4);

Board footer

Powered by FluxBB