# Mgamerz

Member Since 10 Jul 2006
Offline Last Active Nov 29 2011 09:02 PM

### Topics I've Started

10 November 2010 - 07:17 PM

I'm in need of that menu pack that was on the old GMC a few years ago, by Mordi. I've done some searching on google and on GMC and haven't found it anywhere. I know this isn't really a coding question, but does anyone know where it's at, or if they have it, can they mirror it for me?
Thanks.

### "Unknown variable or array out of bounds"

29 October 2010 - 04:04 AM

Here's my code for an LFSR program I have to write. Don't ask why I am doing this, it doesn't matter.
```//LFSR generates a keystream of bits that we will use to perform... another LFSR that challenges the original binary string.
//argument 0=Input/Seed
//argument 1=Key/Polynomial
//argument 2=Length/Clock
var lfsrlength, val, newbit, output, lastbit;
for (i=0;i<string_length(argument0)-1;i+=1)
{
initial[i]=real(string_char_at(argument0,i))//convert to a list
polylist[i]=real(string_char_at(argument1,i))//convert to a list
}
keybits=""
output=""
lfsrlength=string_length(argument0)
show_message(lfsrlength)
for (c=0;c<argument2-1;c+=1) //-1 we start at zero, for clock length do
{
for (o=0;o<lfsrlength-1;o+=1)//o is position in the list of values in the list
{
val=0
if o=0 then //position 0 (leftmost)
{
for (n=0;n<lfsrlength-1;n+=1) //calculating the first round
{
val=val+initial[n]*polylist[n] //preparing to mod
}
output[o]=val mod 2
}
if o!=0 then
{
output[o]=initial[o-1]
}

keybits=string(keybits)+string(output[lfsrlength-1])
}
for (h=0;h<lfsrlength-1;h+=1)
{
initial[h]=output[h]
}
}
return(keybits);
```
Everything in this piece of code works except for
`keybits=string(keybits)+string(output[lfsrlength-1])`
And I don't know why. It always gets an error.

```ERROR in
action number 1
of Create Event
for object obj_LFSR:

In script scr_LFSR:
Error in code at line 33:
keybits=string(keybits)+string(output[lfsrlength-1])
^
at position 45: Unknown variable output or array index out of bounds```
I clearly define it. Everything else works perfectly fine, and output[0] (or just output) return a good value. Why won't it go onto output[1]? I have tried so many things but I do not get it.

I don't know why the code boxes break my GML.

### Preceeding string with 0 (numbers)

07 October 2010 - 03:25 PM

I'm doing a project for school where I'm making an LFSR to turn any string (with only ASCII equivalents)to ASCII codes (numeric with ord() )and then to binary using this script by wormhole. However, any 0's before the first 1 seem to be cut off.
Examples:
10010
1001010
11
All of these pieces of binary should be 8 digits long so I have a cookie cutter pattern of 8 bits (so when we are encrypting/decrypting it (this is for my cryptology class, supposed to code it in something other than MAPLE and GML is all I know at the moment) it will return correctly and not with random bits in places they should be. you can't distinguish when one number ends and another starts)

I need 8 binary bits (1 full byte), otherwise what I'm doing won't work. Please don't just say this is pointless as I need this for work and I don't need your opinion on what application this is useful for or whatnot, I read his thread and people say it's pointless and stuff.
I have everything working up until area.

This is a picture not exactly up to what I have now (I have it printing out the binary next to it too, with it being 1100101 and stuff, the first 0 gets cut off... either that or I'm not inserting the preceeding 0 correctly yet? with string_insert()... can't fix it at the moment, at college)

Oh, and I know I have the ASCII values are off in this picture. They are fixed in the current version, I just don't have any updated images right now. I'll post my code I'm using (although it might confuse some people) once I get home later today.

Left is the letter, Right is the ASCII code.

Thank you if you can help!!!

### Particle Black Hole Effect

04 August 2010 - 07:48 PM

I want to create a 'black hole' kind of effect. Sort of. I know how to make all the particles and stuff I just need to figure out how to create the direction settings so that every particle created heads for a point in the middle. I can do this with objects but I want to use particles...
Does anyone know how to do this? Or at least know what I'm talking about?
I know you can just update the direction every step cause more than 1 particle is created a step.

### Gm8 Ghosting... Why?

04 June 2010 - 06:51 PM

I'm working on a small project that I'm going to record and turn into a video, but right now I'm having a problem. I have it set to work with gravity and I want it to pop up from below, but while I was testing it out it comes up like this.

I don't have it creating more instances and I have nothing but draw_sprite(x,y,sprite_index,image_index) in the draw event (I'm going to use more code later in the draw event).
Anyone know why it's ghosting like this? GM7 never had this problem.