-2

// but the code is throwing unexpected terminal operator new

function MovePokemon(argument0, argument1) {
    old = argument0;
    new = argument1;

    TPartyID = global.PartyID[old]
    global.PartyID[old] = global.PartyID[new]
    global.PartyID[new] = TPartyID;
cpyd
  • 1
  • 1

2 Answers2

0

new is a keyword in the current versions of GameMaker, so you'll need to rename that variable (say, to _new).

The project in question may leave some to be desired given the complete absence of local variable declarations (var).

YellowAfterlife
  • 2,967
  • 1
  • 16
  • 24
0

Try use this code in your script to avoid use "new"

function MovePokemon(argument0, argument1) {

    TPartyID = global.PartyID[argument0]
    global.PartyID[argument0] = global.PartyID[argument1]
    global.PartyID[argument1] = TPartyID;
osama
  • 1
  • 1