Jump to content


nogusielkt

Member Since 17 May 2011
Offline Last Active Yesterday, 11:25 PM

Topics I've Started

Returning 1 Instead Of 0? *Solved*

03 April 2013 - 04:29 PM

Hopefully this is something so obvious that I don't see it.

 

This is in the left pressed of an object.

i=0;
show_message(""+string(i=scr_doihaveit("food")))

it's showing a 1.

 

Normally, the scr_doihaveit script looks like this.

 

i=0;
repeat(100)
{
    if(global.inventory[1,i]=argument0)
    {
        return (i);
    }
    i+=1;
}
return 0;

I've also just commented out everything but the return 0; and it still shows a 1 up there.


Inventory Of Inventories, 3D Array Best Choice?

28 March 2013 - 04:55 AM

At any one time, there can be 1200 instances whose stats I need to keep track of due to them being deleted or deactivated. Each of these 1200 instances has 100 stats. These stats are cobbled together by adding up equipped items totalling 20 and there may be up to 10 unused items on each instance. This would be 3.6 million things to keep track of no matter how I slice it up, but a 3d array seems like it'd be simple.

dude[x,y,z] where x=what dude you are, y=what item you're looking at on that dude, and z=the 100 stats each item can affect

Is there anything bad with this method? (I know 3d arrays aren't included by default, but I've seen some tutorials). I believe I read that it'd take 8-12 bytes per indice, is that a problem? Although the recent patch seemed to bring my fps back up to 55, I've been fighting to keep it as high as possible... is this method near the least intensive?

Wall Of Motion_Add Or Gravity To Push Player Back?

19 March 2013 - 05:10 PM

2d Space game with warping between maps:

 

Looking to make a boundary on the outer limits of the maps to keep the player from leaving without warping.  The map is really a giant room (I think 50k by 50k) and each "room" inside is 4500 x 4500.  I'm looking for a non-intensive (I'm fighting to keep 60 fps right now) way of pushing the player back out of the areas between the "rooms", while still allowing some movement near the border.  Ships move with thrust/acceleration.  I believe anything I'm thinking of right now involves a collision check of some sort.  I could use motion_add or gravity, and push them back towards the sun in the middle of the "room" with point_direction (and I think I'd have to turn gravity back off too, which might be more intensive).

 

Any suggestions?  Tips for the least intensive checks?


Tracking relationships between instances

09 February 2013 - 10:51 PM

I have a few thousand objects and I need to know if they like or hate each other object.  Over the course of the game, thousands of objects will be destroyed and created.  I'll probably only have a hundred or two active at any time.  Originally I was using "array[instance-id]=relationshiptype;", and I'm not even sure why it worked before, but some recent update has broken it.  Regardless, what's the best approach to this?  If it matters, I need it to be as non-intensive as possible, as my framerate will already be challenged by the massive size and actions of the rest of my game.

Using Lengthdir_x with image_angle *solved*

18 October 2012 - 03:42 AM

instance_create(x+lengthdir_x(60,image_angle),y+lengthdir_y(60,image_angle),obj_dodger);

This code creates an instance in front of my ship, no matter which direction I'm facing, relative to the direction I'm facing.  What I'm trying to do is create 2 more instances to the left and right of this object, as if I was 50 pixels offset in either direction (relative to image_angle).  I'm certain I'm overlooking something very simple, but it's late and I'd like to finish this up before I go to bed tonight.

..P
| | |
..E

....P
./ / /
..E