Restore Level MP in a script

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Goggle
Slime
Posts: 6
Joined: Thu Jul 30, 2015 11:39 am
Location: Somewhere on this planet called "Earth"

Restore Level MP in a script

Post by Goggle »

I want a script that not only restores HP and MP, but also Level MP.
I currently already have one for HP and MP, but it doesn't restore Level MP.

I already tried doing:

Code: Select all

set hero stat(0,stat:Level MP, get hero stat(0,stat:Level MP,maximum stat), current stat)
But that can't be imported.

I also already tried looking in my .hsi file, but I can't find anything for Level MP.


Thank you in advance![/code]
User avatar
Goggle
Slime
Posts: 6
Joined: Thu Jul 30, 2015 11:39 am
Location: Somewhere on this planet called "Earth"

Post by Goggle »

I'm still confused.
I've tried doing the following:

Code: Select all

  setlevelmp (0, 0, maximum stat)
but that always sets the first row to 1, even at higher levels.

I also tried

Code: Select all

  getlevelmp (0, 0, maximum stat)
and

Code: Select all

set level mp(0, 0, get level mp(0, 0, maximum stat), current stat)
both of those didn't work.
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

Try..

Code: Select all

variable (TheMax)

TheMax := GetLevelMP (0,0,MaximumStat)
SetLevelpMP (0,0,TheMax)
User avatar
Goggle
Slime
Posts: 6
Joined: Thu Jul 30, 2015 11:39 am
Location: Somewhere on this planet called "Earth"

Post by Goggle »

Code: Select all

ERROR: in script inn on line 54 in
[location here]

Script.txt
     TheMax := GetLevelMP (0,0,MaximumStat)

hard-coded function getlevelmp takes at most 2 arguements but is being passed 3 arguements
In case it might be useful, here is the current inn script:

Code: Select all

plotscript, Inn, begin

   variable (TheMax)
  TheMax := GetLevelMP (0,0,MaximumStat)
  suspendplayer
  suspendnpcs
  stopsong
  fadescreenout 
  playsound (31)

  set hero stat(0,stat:HP, get hero stat(0,stat:HP,maximum stat), current stat)
  set hero stat(0,stat:MP, get hero stat(0,stat:MP,maximum stat), current stat)
  SetLevelMP (0,0,TheMax) 

  set hero stat(1,stat:HP, get hero stat(1,stat:HP,maximum stat), current stat)
  set hero stat(1,stat:MP, get hero stat(1,stat:MP,maximum stat), current stat)   
  SetLevelMP (1,0,TheMax) 

  set hero stat(2,stat:HP, get hero stat(2,stat:HP,maximum stat), current stat)
  set hero stat(2,stat:MP, get hero stat(2,stat:MP,maximum stat), current stat)  
  SetLevelMP (2,0,TheMax) 

  set hero stat(3,stat:HP, get hero stat(3,stat:HP,maximum stat), current stat)
  set hero stat(3,stat:MP, get hero stat(3,stat:MP,maximum stat), current stat)  
  SetLevelMP (3,0,TheMax) 

  wait (90)
  fadescreenin
  showtextbox (12)
  resumeplayer
  resume NPCs

end
Last edited by Goggle on Mon Oct 26, 2015 8:52 pm, edited 2 times in total.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I suspect that you are using the stable beelzebufo version, but reading the plotscript documentation for the nightly wip version.

In the stable release, beelzebufo, the "get level mp" works like this:

Code: Select all

current lmp := get level MP (who, mp level slot)
It always returns the current lmp number, and it is not possible to request the maximum.

If you want to be able to do:

Code: Select all

TheMax := GetLevelMP (0,0,MaximumStat)
You will need to use the nightly wip version. That third argument does not exist in older versions.
User avatar
Goggle
Slime
Posts: 6
Joined: Thu Jul 30, 2015 11:39 am
Location: Somewhere on this planet called "Earth"

Post by Goggle »

Ah, that's a shame.

But thank you anyway!
Post Reply