RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RMVXA] game_actor script help

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 82
The Archivist of Ivilandar
Greetings, I need some help fixing one of my RMVXA scripts. this is a base script that is built into the Ace programming. my error when I play test it occurs when I cause an actor to rise in level.  The specific error reads as follows:

Script 'Game_Actor' line 442: ArgumentError occurred.
too few arguments

The specified line mentioned then reads as follows:
Code: [Select]
      $game_message.add(sprintf(Vocab::ObtainSkill, skill.name))

I'm not much of a coder, thus I am unsure if this is an obvious issue, or something more. May someone please give me some help in this matter?

I apologize if this is also located in the wrong forum as well.
Come by and see my handmade, yet incomplete, site for my game series Midori

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
The only errors I can think of there would be if somehow the Game_Message#add method was changed, or the Vocab::ObtainSkill constant was changed.
Go to line 42 of Vocab (the first module in the script editor), and make sure there is only one %s in there. I'm using my own shoddy translation of the Japanese version, and I have that line as: ObtainSkill     = "learned %s?", I'm not sure if that's what the English version has.
I now want you to check the Game_Message class. Go to line 56. It should read: def add(text)
If that's all fine, then a custom script is overwriting the Game_Message#add method. If this is the case and you don't know how to fix it, post your custom scripts here. It's probably just an extra argument without a default.

And yes, this was the right forum.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 82
The Archivist of Ivilandar
Okay, I checked the Game_Message Script and that was the same.

I think my Vocab lines are out of order. My obtain skill vocab is line 43 instead of 42. I'll post lines 37 through 43 so you can see what's there, though I doubt the location of the ObtainSkill definition doesn't matter.

Code: [Select]
  Victory         = "Victory!"
  Defeat          = "% s has lost the battle"
  ObtainExp       = "The party has received % sXP!"
  ObtainGold      = "The party got % s\G!"
  ObtainItem      = "The party got % s!"
  LevelUp         = "% s leveled up to % s!"
  ObtainSkill     = "% s learned % s!"

Plus I'm not using any custom scripts too.
Come by and see my handmade, yet incomplete, site for my game series Midori

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
You have an extra %s in there.

It should look something like this.

Code: [Select]
ObtainSkill     = "%s was learned!"

**
Rep: +0/-0Level 82
The Archivist of Ivilandar
Ha ha, okay so it was wrong. I had left it as I translated it and it had the two %s.

I just play tested it and that fixed it. So thank you TDS and Pacman.
Come by and see my handmade, yet incomplete, site for my game series Midori

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
TDS is right.
Also, you should change all of those "% s" to "%s". The sprintf format won't interpret "% s" as a special character. You should also change your LevelUp, you have one too few %s in there.
  LevelUp         = "%s is up to %s %s!"
You also need to change Victory, it requires one %s. In ObtainGold, you should change \G to \\G.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 82
The Archivist of Ivilandar
The Victory one actually does not require it. I've been using that since I translated it and it hasn't caused any issues.
Come by and see my handmade, yet incomplete, site for my game series Midori

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
Also, you should change all of those "% s" to "%s". The sprintf format won't interpret "% s" as a special character.

Actually there really isnt a problem with leaving spaces in this situation, except that it looks wrong.

Code: [Select]
test = "% s spaces are great! but look ugly..."
p sprintf(test, "SPACE")
rgss_stop

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Huh. Did not know that. I've just never seen it used that way, so I figured there was a reason. Turns out there is: it looks wrong. ._.
it's like a metaphor or something i don't know