Jump to content

iFoxkun

Members
  • Posts

    189
  • Joined

  • Last visited

Posts posted by iFoxkun

  1. I have modified it a bit, let it's more easy to add item and also fix an error above.


    gm02,94,98,4 script Lower 793,{
    close; //Prevent them from talking to the NPC

    OnInit:

    //Arrays
    setarray .lowerid[0],25200,25201,25202,25203,25204,25205,25206,25207,25208,25209,25210,25211,25212;
    setarray .lowername$[0],"Angel Ears","Emperor Shoulders","Gangster Scarf","Ice Cream","Little Devil Tail","Neko no Shippo","Saiyan Tail","Scarlet Angel Ears","Jirachi Rucksack","Angeling Rucksack","ArchAngeling Rucksack","Deviling Rucksack","Pokeball Rucksack";

    //Regular expressions
    defpattern 1, "([^:]+):.*sNone(.*)", "L_None";
    for(set .@i,0; .@i < getarraysize(.lowerid); set .@i, .@i+1) {
    defpattern 1, "([^:]+):s"+.lowerid[.@i], "L_"+.@i;
    defpattern 1, "([^:]+):s"+.lowername$[.@i], "L_"+.@i;
    }
    activatepset 1;

    end; //Finished with OnInit

    //Label for none
    L_None:
    if(!isequipped(24992)) end;
    setlook 3,0;
    npctalk strcharinfo(0) + " has changed his Dyna Lower Look!";
    end;

    //Label L_.@i ,repeat a label equal your item list (L_? == set .@view_change,?
    L_0:
    set .@view_change,0;
    goto Change_Look;

    L_1:
    set .@view_change,1;
    goto Change_Look;

    L_2:
    set .@view_change,2;
    goto Change_Look;


    Change_Look:
    if(!isequipped(24992)) end; //Make sure they have the item equipped
    setlook 3,getiteminfo(.lowerid[.@view_change],11); // Automaticly Call viewpoint of item that he said and setlook
    npctalk strcharinfo(0) + " has changed his Dyna Lower Look!";
    end;

    }
    [/codeBOX]

    OOOHH <333 It works ~ Less confusing xP. One problem, when I say "none" it doesnt activate D: Also could you make it onwhisperglobal? ;D

  2. 
    gm02,94,98,4 script Lower 793,{
    close; //Prevent them from talking to the NPC
    
    OnInit:
    
    //Arrays
    setarray .@lowerid[0],25200,25201,25202,25203,25204,25205,25206,25207,25208,25209,25210,25211,25212;
    setarray .@lowername$[0],"Angel Ears","Emperor Shoulders","Gangster Scarf","Ice Cream","Little Devil Tail","Neko no Shippo","Saiyan Tail","Scarlet Angel Ears","Jirachi Rucksack","Angeling Rucksack","ArchAngeling Rucksack","Deviling Rucksack","Pokeball Rucksack";
    
    //Regular expressions
    defpattern 1, "([^:]+):.*sNone(.*)", "L_None";
    for(set .@i,0; .@i < getarraysize(.@lowerid); set .@i, .@i+1);{
     defpattern 1, "([^:]+):s"+.@lowerid[.@i], getd("L_"+.@lowerid[.@i]); 
     defpattern 1, "([^:]+):s"+.@lowername$[.@i], getd("L_"+.@lowerid[.@i]); 
    }
    activatepset 1;
    
    end; //Finished with OnInit
    
    //Label for none
    L_None:
     if(!isequipped(24992)) end;
     setlook 3,0;
     npctalk strcharinfo(0) + " has changed his Dyna Lower Look!";
    end;
    
    //Label for item ID 25200, repeat for every item
    L_25200:
     if(!isequipped(24992)) end; //Make sure they have the item equipped
     setlook 3,1700;
     npctalk strcharinfo(0) + " has changed his Dyna Lower Look!";
    end;
    }
    

    Gives me the error of:

    "Data reference name= 'L_0' type=C_Name"

    "Please report this !!!! - str_data.type=C_NOP"

    "Function defpattern"

    "Source (NPC): Lower at gm02 (94,98)

    "script_rid2sd: fatal error! player not attached!"

    "Data: number value=1"

    "Data: string value="([^:]+):s""

    "Data: variable name='L_0'"

    "Source (NPC): Lower at gm02 (94,98)

  3. for ( set .@i, 0; .@i < getarraysize(.@lowerid); set .@i, .@i +1 ) ;

    for ( set .@i, 0; .@i < getarraysize(.@lowername$); set .@i, .@i +1 ) ;

    LOL ? you do a Looping....but...loop nothing but ended it ? hmm ?

    i doubt will that run fine for you upon loaded ? O.O

    suppose to be something like this...

    for ( set .@i, 0; .@i < getarraysize(.@lowerid); set .@i, .@i +1 ) {
    for ( set .@i, 0; .@i < getarraysize(.@lowername$); set .@i, .@i +1 ) ;{
    	 <<content go here>>
    }
    }

    It ran fine actually, except the fact when I type 25200 || none it works, and Angel Ears doesn't I'll try this tomorrow I'm sleepy

  4. I ask too much for help.... D: But its those stinking arrays :<

    I can't seem to get the Angel Ears part to work, but the 25200 part works as well as the "none". Oh and even without the equip '24992' a player can still change his/her look. Help D:.

    
    gm02,94,98,4 script Lower 793,{
    
    if(isequipped(24992)) {
    OnInit:
    setarray .@lowerid[0],25200,25201,25202,25203,25204,25205,25206,25207,25208,25209,25210,25211,25212;
    setarray .@lowername$[0],"Angel Ears","Emperor Shoulders","Gangster Scarf","Ice Cream","Little Devil Tail","Neko no Shippo","Saiyan Tail","Scarlet Angel Ears","Jirachi Rucksack","Angeling Rucksack","ArchAngeling Rucksack","Deviling Rucksack","Pokeball Rucksack";
    for ( set .@i, 0; .@i < getarraysize(.@lowerid); set .@i, .@i +1 ) ;
    for ( set .@i, 0; .@i < getarraysize(.@lowername$); set .@i, .@i +1 ) ;
    
    // == Whisper
    defpattern 1, "([^:]+):.*sNone(.*)", "iNone";
    defpattern 1, "([^:]+):.*s"+.@lowerid[0]+"(.*)", "iAngelEars";
    defpattern 1, "([^:]+):.*s"+.@lowername$[0]+"[.*)", "iAngelEars";
    activatepset 1;
    end;
    // == Action
    iNone:
    setlook 3,0;
    npctalk strcharinfo(0) + " has changed his Dyna Lower Look!";
    end;
    iAngelEars:
    setlook 3,1700;
    npctalk strcharinfo(0) + " has changed his Dyna Lower Look!";
    end;
    } else { end;}
    }
    

  5. 'select' returns an index for the selection the user made.

    1 for the first alternative, 2 for the second and so on... (or if it begins on 0, can't remember)

    You can just use that to index the correct pokemon in the .pkmn$ array: (-1 if it starts on 1, since arrays count from 0)

    if( .pkmn$[.@menu-1] == "Bulbasaur" ) ...
    

    Or if you don't want to go for names, use the index directly:

    switch( .@menu ){
    case 1:
    Bulbasaur code
    break;
    case 2:
    Charmander code
    break;
    case 3:
    Squirtle code
    break;
    }
    

    You only need one for loop in the OnInit aswell:

    OnInit:
    setarray .pkmn$,"Bulbasaur","Charmander","Squirtle";
    setarray .pkmntype$,"Grass","Fire","Water";
    for ( set .@i, 0; .@i < getarraysize(.pkmntype$); set .@i, .@i +1 )
    set .pkmn_menu$, .pkmn_menu$ + (.pkmn$[.@i]) + " - " +...
    

    I tried the second option. The case 1 etc doesn't work and when I close it, the menu option multiplies:

    
    gm02,96,99,4 script Professor Oak 793,{
    
    
    mes "Hello, Welcome to the world of Pokemon";
    next;
    mes "We, Pokemon Trainers, reside in this world in peace with Pokemon";
    next;
    L_SelectPkmn:
    mes "Which starter Pokemon do you wish to have?";
    set .menu, select(.pkmn_menu$) -1;
    switch( .menu ) {
    case 1: 
    next;
    mes "You choose " +.pkmn$[0]+ "?";
    if(select("Yes:No")==2) goto L_SelectPkmn;
    
    
    }
    OnInit:
    setarray .pkmn$,"Bulbasaur","Charmander","Squirtle";
    setarray .pkmntype$,"Grass","Fire","Water";
    for ( set .@i, 0; .@i < getarraysize(.pkmn$); set .@i, .@i +1 ) 
    set .pkmn_menu$, .pkmn_menu$ + (.pkmn$[.@i]) + " - " + (.pkmntype$[.@i]) +":";
    }
    

  6. gm02,96,99,4 script Professor Oak 793,{
    
    
    mes "Hello, Welcome to the world of Pokemon";
    next;
    mes "We, Pokemon Trainers, reside in this world in peace with Pokemon";
    next;
    mes "Which starter Pokemon do you wish to have?";
    set .@menu, select(.pkmn_menu$) -1;
    if(.pkmn_menu$[0] == .pkmn$[0]):
    mes "You choose " +.pkmn$[0]+ "?";
    
    OnInit:
    setarray .pkmn$,"Bulbasaur","Charmander","Squirtle";
    for ( set .@i, 0; .@i < getarraysize(.pkmn$); set .@i, .@i +1 )
    setarray .pkmntype$,"Grass","Fire","Water";
    for ( set .@i, 0; .@i < getarraysize(.pkmntype$); set .@i, .@i +1 )
    set .pkmn_menu$, .pkmn_menu$ + (.pkmn$[.@i]) + " - " + (.pkmntype$[.@i]) +":";
    }
    

    The one text bolded, How do i make it, if a player selects option 1, Bulbasaur, it says something?

    This one : if(.pkmn_menu$[0] == .pkmn$[0]):

×
×
  • Create New...