1. Welcome to Game Makers Forums

    Whether you are a new, amateur or professional developer, you will find your place here.

    Register to Download Sample Code or Advertise your Project.

    Register also gives you the ability to be helped or help others:

    Dismiss Notice

PokeMon Name entry help needed

Discussion in 'PC, Consoles, PDAs, and Cell Phones' started by Dan, Jun 7, 2016.

  1. Dan

    Dan New Member

    Joined:
    Jun 7, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I run my code in debug mode and the first letter entry always moves to second position, when I restart in debug mode it works perfectly. My code looks good but something is screwing it up and I cant find the source. I would appreciate another set of eyes to look over my code. I am using game Maker pro 8.0https://drive.google.com/file/d/0BxDIBbQOZ2OVVEVLUV83Y1VNZ1U/view?usp=sharing
     
  2. Dan

    Dan New Member

    Joined:
    Jun 7, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    No help on this? Not a very active forum i guess, Ill look for another
     
    • Friendly Friendly x 1
  3. gamble

    gamble Active Member

    Joined:
    Apr 12, 2015
    Messages:
    117
    Likes Received:
    43
    Trophy Points:
    28
    Gender:
    Male
    Not many people on here are too familiar with Game Maker.
     
    • Agree Agree x 1
  4. Colum Ferry

    Colum Ferry Moderator

    Joined:
    Jan 8, 2015
    Messages:
    654
    Likes Received:
    219
    Trophy Points:
    43
    Gender:
    Male
    And you are better to post any relevant code within the post itself to allow us to help as not everyone has time to download and setup projects
     
    • Winner Winner x 1
  5. 1imPunter

    1imPunter Antique Coder

    Joined:
    Oct 4, 2014
    Messages:
    1,533
    Likes Received:
    254
    Trophy Points:
    83
    Gender:
    Male
    Occupation:
    Freelance Programmer
    Location:
    Online @ Baltimore, MD, USA
    and posting in the right section helps.

    -Moved-
     
  6. a_bertrand

    a_bertrand Administrator

    Joined:
    Oct 28, 2014
    Messages:
    1,264
    Likes Received:
    562
    Trophy Points:
    113
    Gender:
    Male
    No way I must download something (not knowing even exactly what it is) to try to help you. Sorry but if you would have post just the tiny piece as text which doesn't work maybe we could have helped you, but I doubt many will do if you keep just sending the whole like that.
     
  7. Dan

    Dan New Member

    Joined:
    Jun 7, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Here is the create event
    //global.FONT = font_add_sprite(spr_fontYES, 33, 0, 1);
    global.name=""
    row=1;
    column=1;
    global.name="";
    backspace=false;
    forwardspace=false;
    nameEnter=false;
    yesno=0
    n=1
    c=0
    i=1;

    name[1]=" "
    name[2]=""
    name[3]=""
    name[4]=""
    name[5]=""
    name[6]=""
    name[7]=""
    name[8]=""
    name[9]=""
    name[10]=""
    name[11]=""
    name[12]=""

    letter[1,1]="A";
    letter[1,2]="B";
    letter[1,3]="C";
    letter[1,4]="D";
    letter[1,5]="E";
    letter[1,6]="F";
    letter[1,7]="G";
    letter[1,8]="H";
    letter[1,9]="I";
    letter[2,1]="J";
    letter[2,2]="K";
    letter[2,3]="L";
    letter[2,4]="M";
    letter[2,5]="N";
    letter[2,6]="O";
    letter[2,7]="P";
    letter[2,8]="Q";
    letter[2,9]="R";
    letter[3,1]="S";
    letter[3,2]="T";
    letter[3,3]="U";
    letter[3,4]="V";
    letter[3,5]="W";
    letter[3,6]="X";
    letter[3,7]="Y";
    letter[3,8]="Z";
    letter[3,9]=" ";
    letter[4,1]="x";
    letter[4,2]="(";
    letter[4,3]=")";
    letter[4,4]=":";
    letter[4,5]=";";
    letter[4,6]="[";
    letter[4,7]="]";
    letter[4,8]=" ";
    letter[4,9]=" ";
    letter[5,1]="-";
    letter[5,2]="?";
    letter[5,3]="!";
    letter[5,4]=" ";
    letter[5,5]=" ";
    letter[5,6]="/";
    letter[5,7]=" ";
    letter[5,8]=" ";
    letter[5,9]=" ";












    Ok here is the the code for the step event

    keyK = keyboard_check_pressed(ord('K'))
    keyL = keyboard_check_pressed(ord('L'))
    keyI = keyboard_check_pressed(ord('I'))
    keyO = keyboard_check_pressed(ord('O'))
    keyF = keyboard_check_pressed(ord('F'))
    keyN = keyboard_check_pressed(ord('N'))
    keyB = keyboard_check_pressed(ord('B'))
    keyP = keyboard_check_pressed(ord('P'))
    keyG = keyboard_check_pressed(ord('G'))
    keyR = keyboard_check_pressed(ord('R'))
    keyZ = keyboard_check_pressed(ord('Z'))
    keyU = keyboard_check_pressed(ord('U'))
    keyUP = keyboard_check_pressed(ord('W'))
    keyDOWN = keyboard_check_pressed(ord('S'))
    keyRIGHT = keyboard_check_pressed(ord('D'))
    keyLEFT = keyboard_check_pressed(ord('A'))

    // Move cursor forward
    if row==5 && column==7 && keyK
    {
    backspace=true
    // sound_play(snd_moveCursor)
    n-=1
    if n==0
    n=1
    if n==13
    n=12
    io_clear()
    }
    // Move cursor backword
    if row==5 && column==8 && keyK
    {
    backspace=true
    // sound_play(snd_moveCursor)
    n+=1
    if n==0
    n=1
    if n==13
    n=12
    io_clear()
    }

    if row==5 && column==9 && keyK
    {
    nameEnter=true
    global.name=name[1]+name[2]+name[3]+name[4]+name[5]+ name[6]+name[7]+name[8]+name[9]+name[10]+name[11]+name[12]

    }

    //Move select arrow to different letter
    if keyRIGHT && nameEnter==false
    {
    backspace=false
    // sound_play(snd_moveCursor)
    column+=1
    if column==10
    {
    column=1
    row+=1
    if row==6
    row=5
    }
    }
    if keyLEFT && nameEnter==false
    {
    backspace=false
    // sound_play(snd_moveCursor)
    column-=1
    if column==0
    {
    column=9
    row-=1
    if row==0
    row=1
    }
    }
    if keyUP && nameEnter==false
    {

    backspace=false
    // sound_play(snd_moveCursor)
    row-=1
    if row<1
    row=1
    }
    if keyDOWN && nameEnter==false
    {

    backspace=false
    // sound_play(snd_moveCursor)
    row+=1
    if row>5
    row=5
    }

    // Select letter to add to your name string
    if keyK && nameEnter==false && backspace==false
    {
    name[n]=letter[row,column]
    n+=1

    if n==13
    n=12
    io_clear()

    }


    And here is the code for the draw event have fun
    draw_set_font(font1)
    draw_sprite(spr_nameEntry,-1,x,y)

    if nameEnter==false
    {
    draw_sprite(spr_select2,-1,column*32-20,row*32+65)
    draw_sprite(spr_selCursor,-1,n*16+92,32)

    for (i=1 ; i <= 12; i += 1)
    {
    draw_text(i*16+110,17,string(name))

    }
    }
    if nameEnter==true
    {
    draw_set_halign(fa_left)
    draw_text(25,250,string(global.name))
    draw_sprite_ext(spr_YesNo,-1,224,224,2,2,0,c_white,1)
    if yesno==1
    {
    draw_sprite_ext(spr_select2,-1,240,236,2,2,0,c_white,1)
    }
    if yesno==0
    {
    draw_sprite_ext(spr_select2,-1,240,256,2,2,0,c_white,1)
    }

    draw_set_halign(fa_right)
    draw_text(300,234,"Yes#No")

    }
     
  8. 1imPunter

    1imPunter Antique Coder

    Joined:
    Oct 4, 2014
    Messages:
    1,533
    Likes Received:
    254
    Trophy Points:
    83
    Gender:
    Male
    Occupation:
    Freelance Programmer
    Location:
    Online @ Baltimore, MD, USA
    DanDan the code might be easier to read and understand if you use the + Insert Code so it is formatted:

    format_code.png
     
  9. a_bertrand

    a_bertrand Administrator

    Joined:
    Oct 28, 2014
    Messages:
    1,264
    Likes Received:
    562
    Trophy Points:
    113
    Gender:
    Male
    Ok now we have your code, but I still fail to see what you are expecting and what happens. What doesn't work ?
     

Share This Page