RMMV MV script calls crashes if trying to restore party

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV



I tried to Memorise Party Members, clear party (which removes all characters including main), then use restore party members where it crashes. It happens in a new game too, so wondering if I'm missing a step here. Using the example (variable 1 for both scripts) would crash too.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,845
Reaction score
7,875
First Language
English
Primarily Uses
RMMZ



I tried to Memorise Party Members, clear party (which removes all characters including main), then use restore party members where it crashes. It happens in a new game too, so wondering if I'm missing a step here. Using the example (variable 1 for both scripts) would crash too.

Can you show me the actual script you've written for this?
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
Can you show me the actual script you've written for this?
Get syntax error in first step when starting a new project; old project crashes at 2nd step.
 

Attachments

  • v1.jpg
    v1.jpg
    150.5 KB · Views: 10
  • v2.jpg
    v2.jpg
    155.2 KB · Views: 10

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,845
Reaction score
7,875
First Language
English
Primarily Uses
RMMZ
What's the crash?
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
It crashes at the step saving variable.

syntax.jpg
 
Joined
Oct 12, 2022
Messages
2
Reaction score
2
First Language
English
Primarily Uses
RMVXA
yes ast least in the setvalue(1

needs the ) behind the 1)
so
setvalue(1)

i havnt been awake long it may take more than that
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
yes ast least in the setvalue(1

needs the ) behind the 1)
so
setvalue(1)

i havnt been awake long it may take more than that

I've tried and it either crashes or the variable ends up as 0 when asked.

If simply copying the example the script page has then add ) to make that line look like
setvalue(1),
it would crash with the same error.

If I remove the ); in the end , it no longer crashes but when asked in text, variable 1 gets 0 as result.
 

eomereolsson

Regular
Regular
Joined
Sep 29, 2021
Messages
582
Reaction score
508
First Language
German
Primarily Uses
RMMV
yes ast least in the setvalue(1

needs the ) behind the 1)
so
setvalue(1)

i havnt been awake long it may take more than that
This is incorrect. $gameVariables.setValue(x, y) needs the id x of the variable and the value y to set. You can't cut off the value and expect it to work.

There is actually an error in the example provided in the script call spreadsheet.
In the spreadsheet the code looks like this:
JavaScript:
// Save
$gameVariables.setValue(id,
  $gameParty.members().map(function(actor) {
    return actor.actorId();
  });
);

However the ; in the second to last line ends the statement prematurely. The last ); get treated as their own second statement after the first. That is why the first statement is missing its closing ).

The following should work as intended:
JavaScript:
// Save
$gameVariables.setValue(id,
  $gameParty.members().map(function(actor) {
    return actor.actorId();
  })
);
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
This is incorrect. $gameVariables.setValue(x, y) needs the id x of the variable and the value y to set. You can't cut off the value and expect it to work.

There is actually an error in the example provided in the script call spreadsheet.
In the spreadsheet the code looks like this:
JavaScript:
// Save
$gameVariables.setValue(id,
  $gameParty.members().map(function(actor) {
    return actor.actorId();
  });
);

However the ; in the second to last line ends the statement prematurely. The last ); get treated as their own second statement after the first. That is why the first statement is missing its closing ).

The following should work as intended:
JavaScript:
// Save
$gameVariables.setValue(id,
  $gameParty.members().map(function(actor) {
    return actor.actorId();
  })
);
Now the script's working like intended, thank you.
 

Latest Threads

Latest Posts

Latest Profile Posts

Bought myself a single booster of Revised edition MtG and it was not a winner. RIP.
Surprising to come back and my last profile post still resonates years later... Air is still dry. Hello again forum!
If you haven’t had the opportunity to check it out yet, here’s day #4 for advent compiled! Today’s question! Real tree or fake tree?
its funny how bell sound looks like bell :D
Only took me a couple hours to get the light blocking on doors done for the first map.

Forum statistics

Threads
136,748
Messages
1,269,491
Members
180,484
Latest member
nekopara
Top