News:

Welcome to the new Sinister Design forums!

Main Menu

Errors found by bugfartboy

Started by bugfartboy, June 04, 2015, 11:38:23 PM

Previous topic - Next topic

bugfartboy

Rather than make a new thread anytime I find a new bug or error, I'll just put them all here from now on.

The game generated this one on its own, after I added a new script using the SetStatByStat action.  Here's the last section of the log attached, where it threw the error.

977 |      running runAction() in DialogScreen; currActionString = Run/UpdateStats
978 | running getScript( UpdateStats ) in StartBattle
979 |      scriptActions[0] = SetStatByStat/ID[000],Max Health,=,-FNAME-,Max Health
980 |      scriptActions[1] = SetStatByStat/ID[000],Max Energy,=,-FNAME-,Max Energy
981 |      scriptActions[2] = SetStatByStat/ID[000],Strength,=,-FNAME-,Strength
982 |      scriptActions[3] = SetStatByStat/ID[000],Psy Power,=,-FNAME-,Psy Power
983 |      scriptActions[4] = SetStatByStat/ID[000],Psy Defense,=,-FNAME-,Psy Defense
984 |      scriptActions[5] = SetStatByStat/ID[000],Speed,=,-FNAME-,Speed
985 |      scriptActions[6] = SetStatByStat/ID[000],Dodge,=,-FNAME-,Dodge
986 |      scriptActions[7] = SetStatByStat/ID[000],Counter Limit,=,-FNAME-,Counter Limit
987 |      scriptActions[8] = SetStatByStat/ID[000],Perception,=,-FNAME-,Perception
988 |      scriptActions[9] = SetStatByStat/ID[000],Slash Res.,=,-FNAME-,Slash Res.
989 |      scriptActions[10] = SetStatByStat/ID[000],Crush Res.,=,-FNAME-,Crush Res.
990 |      scriptActions[11] = SetStatByStat/ID[000],Mental Res.,=,-FNAME-,Mental Res.
991 | running runScript( SetStatByStat/ID[000],Max Health,=,-FNAME-,Max Health,SetStatByStat/ID[000],Max Energy,=,-FNAME-,Max Energy,SetStatByStat/ID[000],Strength,=,-FNAME-,Strength,SetStatByStat/ID[000],Psy Power,=,-FNAME-,Psy Power,SetStatByStat/ID[000],Psy Defense,=,-FNAME-,Psy Defense,SetStatByStat/ID[000],Speed,=,-FNAME-,Speed,SetStatByStat/ID[000],Dodge,=,-FNAME-,Dodge,SetStatByStat/ID[000],Counter Limit,=,-FNAME-,Counter Limit,SetStatByStat/ID[000],Perception,=,-FNAME-,Perception,SetStatByStat/ID[000],Slash Res.,=,-FNAME-,Slash Res.,SetStatByStat/ID[000],Crush Res.,=,-FNAME-,Crush Res.,SetStatByStat/ID[000],Mental Res.,=,-FNAME-,Mental Res. ) in StartBattle
992 |    DialogScreen open--running script!
993 |    running runScript() in DialogScreen; scriptActions.length = 12
994 |      scriptActions[0] = SetStatByStat/ID[000],Max Health,=,-FNAME-,Max Health; now converting special characters!
995 |
996 |      running runAction() in DialogScreen; currActionString = SetStatByStat/ID[000],Max Health,=,Psy Fighter,Max Health
997 | ArgumentError 1063: Error #1063
998 | ArgumentError: Error #1063
at DialogAction/executeAction()
at DialogAction()
at DialogScreen/runAction()
at DialogScreen/runScript()
at StartBattle/runScript()
at DialogAction/executeAction()
at DialogAction()
at DialogScreen/runAction()
at DialogScreen/runSpecialActions()
at DialogScreen/bgLoaderReady()
999 | ---------> running saveLog() within LogHandler!

I'm not sure if this was just me doing something incorrectly that the game really didn't like, or if it's an actual bug.  Either way, the game in general stopped functioning after this occurred.

Also, as a side note, SetStringByStat isn't in the manual, as of game version 1.033.


-EDIT-
Mousing over any character's abilities (walk, done, rotate, move, etc) will trip an OnCharSelect trigger if one applies to a that character.  This means if a script is set to run any time a character is selected, it can be tripped many times over the course of just a few seconds.

-EDIT2-
When a unit has max health in the single digits, the energy icon overlaps onto it on that unit's tool-tip.

CraigStern

Try changing ID[000] to ID[0] and see if that fixes it. (IDs take numbers as parameters--the game might be choking on "000," which isn't an actual number.)

bugfartboy

I'll try that. I've been using ID [000] everywhere else, however, and it works just fine.

bugfartboy

#3
Using an item-triggered script to trip an OnVal dialog trigger causes the game to throw an error, generate a log, and freeze.

-EDIT-
Spawning characters on a map with their class name still spawns characters with the same name as their class instead of a randomly picked name like it should. e.g. Spawning a character with a class of "Arena Worker" will create the character with the name of "Arena Worker".  Using the SpawnChar command works correctly, however.

CraigStern

The error here is in the script--you accidentally skipped over the "needs to be equipped" parameter for IfItemGoTo, which resulted in the "branch to go to" parameter being left blank. The game is registering the "branch to go to" in IfItemGoTo as null and substituting a 0--so when it finds the Game Menu item, it goes back to branch 0, causing it to run all of those script actions over again, which makes it go back to branch 0 again, etc. resulting in an infinite loop. :)

Try this instead:

IfItemGoTo/ID[000],Game Menu,false,BNAME[Game Menu]

bugfartboy

Yeah  that did the trick.  I should really stop working on this stuff after 2 A.M.  Thanks Craig!

CraigStern


bugfartboy

#7
Hopefully will be fixed when the Inventory system is finished being rewritten, but adding an item to a character's inventory via scripts while the inventory box is open will prevent the item from being saved and stored when the box is closed. e.g. Giving a character a new copy of an item after they use it will cause the new copy to not appear.


I've also hit a bit of a personal snag recruiting randomly generated characters.  I've compared my scripts to yours from Recruitable Chars, and the only big difference between the two is that my characters are generated at the start of the level, opposed to your characters generated just before recruitment.
A sample of my recruitment scripts and dialog:

<Dialog branch="0" r="-1" name="top">
    OnTalk/ID[000],ID[514]/-STR:speakerName-/I'm -STR:speakerName- the -STR:speakerClass-! For a small sum of aura, I'll fight by your side to the death.-N-[Cost: -VAL:recruitPrice- aura][Aura: -VAL:currentAura- aura]
    <Action>SetStringByStat/speakerClass,ID[514],Class</Action>
    <Action>SetStringByStat/speakerName,ID[514],Name</Action>
    <Action>SetValByStat/speakerY,=,ID[514],Y Coord</Action>
    <Action>SetValByStat/speakerX,=,ID[514],X Coord</Action>
    <Action>AssignSpeakerAtCoords/-VAL:speakerY-,-VAL:speakerX-</Action>
    <Action>Run/Set -STR:speakerClass- Info</Action>
    <Action>RotateCharToFace/ID[000],-STR:speakerName-</Action>
    <Reply>What are you good for? [Class Info]/NewBranch/BNAME[Class Info]</Reply>
    <Reply>You're hired! [Pay -VAL:recruitPrice- aura.]/NewBranch/BNAME[Attempt Recruit]</Reply>
    <Reply>Not right now, thanks. [Leave.]/NewBranch/BNAME[done]</Reply>
  </Dialog>
  <Dialog branch="1" r="-1" name="done">
    OnTalk/ID[000],ID[514]/-STR:speakerName-/Oh. Okay then.
    <Action>RotateChar/-STR:speakerName-,Down</Action>
    <Reply>.../EndConv/</Reply>
  </Dialog>
  <Dialog branch="2" r="-1" name="Class Info">
    OnTalk/ID[000],ID[514]/-STR:speakerClass-/-STR:classInfo-
    <Reply>.../NewBranch/BNAME[top]</Reply>
  </Dialog>
  <Dialog branch="3" r="-1" name="Attempt Recruit">
    OnTalk/ID[000],ID[514]/-STR:speakerName-/Ouch. I don't work for cheap. Come back when you've got some aura.
    <Action>IfValGoTo/currentAura,g=,-VAL:recruitPrice-,BNAME[Recruit Success]</Action>
    <Reply>.../EndConv/</Reply>
  </Dialog>
  <Dialog branch="4" r="-1" name="Recruit Success">
    OnTalk/ID[000],ID[514]/-STR:speakerName-/Great! I'll gather my belongings and prepare for battle.
    <Action>PlaySound/Coins Jingle</Action>
    <Action>SetVal/currentAura,-,-VAL:recruitPrice-</Action>
    <Reply>.../NewBranch/BNAME[Recruit Done]</Reply>
  </Dialog>
  <Dialog branch="5" r="-1" name="Recruit Done">
    OnTalk/ID[000],ID[514]/[Arena]/Retagging the new recruit, adding to roster, and removing from screen.
    <Action>SetVal/totalRecruited,+,1</Action>
<Action>RemoveTag/-STR:speakerName-,ID,514</Action>
    <Action>AddTag/-STR:speakerName-,ID,-VAL:totalRecruited-</Action>
    <Action>RecruitChar/ID[-VAL:totalRecruited-]</Action>
    <Action>SpawnParticlesAt/Smoke,-VAL:speakerY-,-VAL:speakerX-</Action>
    <Action>RemoveChar/ID[-VAL:totalRecruited-]</Action>
    <Action>EndConvImmediately/</Action>
    <Reply>.../EndConv/</Reply>
  </Dialog>

Your recruitment script:

<Script>Spawn Recruit
    <Action>SpawnChar/0,-STR:RecruitClass-,-VAL:RecruitY-,-VAL:RecruitX-,Down,,Add:ID:-VAL:RecruitNum-</Action>
    <Action>SpawnParticlesAt/Smoke,-VAL:RecruitY-,-VAL:RecruitX-</Action>
    <Action>RecruitChar/ID[-VAL:RecruitNum-]</Action>
    <Action>SetStat/ID[-VAL:RecruitNum-],Steps Left,=,0</Action>
    <Action>SetVal/RecruitX,+,1</Action>
    <Action>IfValRun/RecruitX,g,9,Next Row</Action>
  </Script>

Am I missing something important?  Any time I enter a battle with my recruited characters, they have names but nothing more, whereas yours works perfectly.

CraigStern

Quote from: bugfartboy on June 09, 2015, 03:51:52 PMadding an item to a character's inventory via scripts while the inventory box is open will prevent the item from being saved and stored when the box is closed.

Fixed for the next update. :)

I'm not sure what the problem is in your script--are you just taking an existing character and trying to reconfigure all of their stats on the fly using SetStat instead of spawning them based on a class?

bugfartboy

No, I have them saved as randomly named classes in CharClasses.xml and spawn them onto the stage via script at OnLoaded. When I get home I'll try adding them to the map directly and see if that fixes it.

Another thing I noticed was that character names were being added to my player roster, but none of their stats were. I added another character earlier in much the same way and it worked perfectly: attacks and stats were added to the save file properly. The only real difference between that and this is that he was added to the stage directly.

CraigStern

Adding a character to a roster will save them to the roster, but you have to actually spawn the character on army 0 (or on a different army, then convert them to army 0) if you want the game to save that character's stats when the scene ends.

bugfartboy

#11
That would be the problem, then.  Currently they spawn on team 1.  If I want to add them to my roster correctly, I need to use SetStat/ID[???],Army,=,0?  I thought about this the other night, but didn't think to try it.  Oh well.  Thanks again, Craig! :)



Yeah, that solved the issue.  Out of curiosity, though, if I had a second roster with a value of 1 would they have been recruited to and stored there instead?  Actually, I'll find out on my own.

CraigStern

Quote from: bugfartboy on June 11, 2015, 05:10:00 PMIf I want to add them to my roster correctly, I need to use SetStat/ID[???],Army,=,0?

Sort of. Them being present on army 0 when the scene ends just saves their stat values to the player's saved game file, which the game will then refer to the next time they're loaded onto the battlefield (instead of loading their stat values straight out of CharClasses.xml). They'll be present on the roster either way, though--a character's name appearing on the roster is totally independent of whether their stats are saved in the save game file or not.

As for which roster they're present on, well, that just depends on which roster you added them to.

bugfartboy

#13
Quote from: CraigStern on June 11, 2015, 05:25:05 PM
As for which roster they're present on, well, that just depends on which roster you added them to.
Maybe I need to just look at the tutorials more, but how would one do that? There's only 1 parameter to the RecruitChar action.
Quote from: CraigStern on June 10, 2015, 04:52:50 PM
Fixed for the next update. :)
As for this, thanks! I got around it, for now, by setting my item's consumedAfter to 0.  As a side note, how difficult would it be to make it stay at 0 or just disregard its durability in general? Any time I use it, it drops into the negatives.  It's a little odd walking around with an item with -253 uses left.

CraigStern

Quote from: bugfartboy on June 11, 2015, 05:29:15 PM
how difficult would it be to make it stay at 0 or just disregard its durability in general? Any time I use it, it drops into the negatives.  It's a little odd walking around with an item with -253 uses left.

Oops! It shouldn't be degrading if its durability is set to 0. Fixed.