Jump to content


kennypu

Member Since 27 Dec 2005
Offline Last Active May 27 2011 09:12 PM

Topics I've Started

Solved: Weird Ds_list Error? Or Syntax

25 May 2009 - 05:03 AM

wow, i havn't posted on gmc in a while. anyways I'm not sure whether I should put this on here in novice or in advanced, but I think it's appropriate here.
some background info. I have a ds_list of global.current_inventory, and global.inventory_amount
global.current_inventory is set up like this:
0 - pistol
1 - shotgun
2 - machine gun
3 - ak47
4 - lol
5 - mystery item
6 - heehee.
now i'm basicly making a simple inventory system, and I was trying to get it to do simple scrolling, showing values of 5 variables that handle which items in the inventory should be shown. draw_primary[4] is the variables. heres the mystery code:
...
else
{
	var it;
	it=cursor_pos;
	draw_primary[0] = ds_list_find_value(global.current_inventory,it-2)+ " "+ string(ds_list_find_value(global.inventory_amount,it-2));
	draw_primary[1] = ds_list_find_value(global.current_inventory,it-1)+ " "+ string(ds_list_find_value(global.inventory_amount,it-1));
	while( (it < cursor_pos + 3) and it < max_inventory)
	{
		draw_primary[it-(it-2)] = ds_list_find_value(global.current_inventory,it)+ " "+ string(ds_list_find_value(global.inventory_amount,it));
		it+=1;

	}
}
cursor_pos is where the cursor is. basicly everything works fine, except that for some odd reason that I can't pinpoint, draw_primary[2] is equal to cursor_pos + 2 everytime. so for example, following the list i showed earlier, when the cursor is at 'machine gun', this is what is shown:
pistol - value
shotgun - value
lol - value
ak47 - value
lol - value
as you can see, the 1st lol, should be machine gun. Any one have an idea where I went wrong? Thanks in advance,
  Kennypu

EDIT:
FIXED, i was just over complicating things :3

Request: Christmas Ornaments

22 September 2008 - 12:42 AM

Hey, I'm requesting a christmas ornament sprites. a variety will be nice, but just one is ok.

dimensions: 32x32 - 256x256 (the bigger the better)
for the ornaments, I don't want technical ornaments, just basicly circles with nice designs on it. The designs itself is up to you :]. Thanks in advance,
  Ken

Hihi, Any Ideas On Speeding This Up?

24 July 2008 - 07:48 AM

hey, kennypu here. Recently I got into the demoscene, and I coded a few stuff in c++, then I wondered if some of the effects can be done with Game Maker. So here I am trying to do a plasma effect.
   Now after a few hours of trial and error, a few of my own ideas put it, I managed to get one working. The only problem: it is quite slow. I was wondering if any one has any better idea on how to do this(basicly optimize). I will post the looping part, and the source, any one can use for what ever since its not so great yet. I posted here since I doubt this belongs in the expert section, not l33t enough :]. I just wanted to know if this is just the limitations of GM, to render pixel by pixel, or if there is another way. Nyways heres a screenshot:
Posted Image

code snippet:
//create event
s = surface_create(room_width,room_height);
surface_set_target(s);
draw_clear(c_black);
surface_reset_target();
multi=8;
freq = 63.5;//63.5 for original
value = 128+(freq*sin(x/multi))+(freq*sin(y/multi));
plasma[room_width,room_height] = 0;
buffer[room_width,room_height] = 0;
palette[256] = 0;
x = 0;
y = 0;
//demo code

for(col=0;col<256;col+=1)
{
	colrgb = make_color_hsv(col,255,255);
	palette[col] = floor(colrgb);
}
for(i=0;i<room_width;i+=1)
{
	for(j=0;j<room_height;j+=1)
	{
		value = 128+(freq*sin(i/multi))+(freq*sin(j/multi));
		color = floor(value/2);
		plasma[i,j] = color;
	}
}

paletteShift = 10;
//step event, tried alarm to control speed as well
paletteShift+=5;

surface_set_target(s);
for(i=0;i<room_width;i+=1)
{
	for(j=0;j<room_width;j+=1)
	{
	 //   buffer[i,j]=palette[(plasma[i][j]+paletteShift) % 256];
		draw_pixel(i,j,palette[(plasma[i,j]+paletteShift) mod 256]);
	}
}
//draw_pixel_hsv(x,y,value,255,255);
surface_reset_target();
For those of you who are interested: plasma_effect.gm6
Any help or suggestions much appreciated, thanks in advance,
  Ken

Quick Question About A Function

28 June 2008 - 01:16 AM

what does the function object_is_ancestor(ind1,ind2), do? the manual is kinda vague in definition so im just asking to clear things up. Is it used to find the child, or is it used like in the case that ind1 creates ind2, thus being its ancenstor. or something else. Thanks in advance,
  Ken

[rumor] New 3d Engine For Gm

31 March 2008 - 04:23 AM

I heard a rumor going around that theres a new 3D engine in making by 'X-tra fear', called Behemoth(?). Is this true, and/or what do you think about it?
EDIT: mybad forgot, i heard it will have some nice shader effects(pixel, bloom effect, bump maps), but yea...I wonder if its true, and when it will come out..
  Ken