Posts for MUGG


Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
MLSS Script v0.5
- Added "Run Event". You can choose the event from a list (depends on which ROM of the game is used) and it will be run on the spot.
- EditActionCommands: Fixed that the script sometimes crashed when closing the EditActionCommands display while the "Edit" form was not active.
- MushCalculator: Fixed that MushCalculator did not recognize the European ROM.
- Added SwingBros, CycloneBros, FireBros, ThunderBros to "Basic Info" and to "Notifications".
- Basic Info: Added indicator of how long it took to switch the brothers' places.
Please play around with the Run Event thing and let me know if you have questions or thoughts. I didn't go to search for pointers on the european version because I think nobody uses it anyway. Some explanations on events and on how "Run Event" should be used: Events are basicly cutscenes. There are two layers, which allows the game to run two events at the same time (but I haven't really seen it do so - I don't know the real explanation why it uses two layers). For each layer, there is an address that stores an event pointer, and an address that tells what to do with it (i.e. activity). There is also a timer address.: (All addresses are EWRAM, 4 bytes) Layer1: $4ac4 Activity* $4ac0 Timer $4a24 Pointer Layer2: $4b6c Activity* $4b68 Timer $4acc Pointer * 0 = not active, nothing happens 1 = active, the event is run 3 = if the event pointer is invalid, increments the event pointer until a valid one is found 5 = waiting for an object or brother to reach a certain position before running the event 11 = waiting for the timer address to decrement down to 0 before running the event Most cutscenes (events) are basicly "move sprite XY over there, play this sound, give him this animation pattern, fade out now, ...". If you force such events to run in a wrong room, then very unexpected behavior can happen, usually leading to the emulator's crash. Some events are robust, however, and can be forced to run almost always without consequences. This is because those events usually fade into the correct room or screen and then go on from there, rather than trying to do something with wrong objects in a wrong room. I have gone looking for those robust pointers and now you can select them from a list in my script and run them as you like. This includes - saving anywhere - shopping anywhere - fighting bosses at any time - going to certain points in the game I wrote those robust events can "almost always" be run without consequences. You see, as for events that start boss fights (and some others), if you beat the boss then you will often not be placed in the room where the boss was but will rather go on from where you were - and the game may try to run a post-battle event. And as said, bad things happen when cutscenes are forced to run in the wrong room. You can't just disable that post-battle event either, because then the game softlocks on a black screen after the battle. But you can overwrite it with another event, and I made my script so that it overwrites it with one that does nothing (specifically, the fade-in that happens after finishing saving the game). (As for the koopaling teleports in my script, you may need to be both brothers, and it may cause glitchy behavior if you are in another event already, so be cautious.) In the "Run Event" display in my script, the "Prevent problems" option does what I said above: Overwrites post-battle or post-Little Fungitown minigame dialogues and events with something that does nothing. The "Override" option will let you override events that are already running - this may cause unexpected behavior and may mess up the camera, so be careful, but otherwise should work well. If this option is turned off, you will not be able to run an event if there is already one running in the game. There are some known problems, like if you use the "Prevent problems" option with the koopaling teleports, then you may not actually teleport there. Just use savestates for safety before doing something. Speaking of which, be careful when running events while the game is faded out and don't load states right after attempting to run an event. Also: Battles, the staff credits, minigames are all handled differently and you cannot run anything when those are active - in fact, you can run something but it will be postponed to run until after the battle or minigame(not sure) is finished. Oh also: If you start a new game and go to some later point in the game directly, you will lack action commands (hammers, highjump etc.) and will be unable to use hammers in battle, and also may be unable to use bros attacks and flee in-battle. Be cautious. I may add something later so you get all that stuff automatically, but right now I don't know how it even works so I can't add it yet. The prefix for each list item is just for some clarity. It does not have any deeper meaning. There is Prog (progress-related), Boss, Game (mini game), Scr (screen) and Other (anything that doesnt fit in the other categories). I'm really not sure, but on US, the game may freeze when attempting to save the game where you aren't supposed to, but does not freeze on JP. Needs more testing to be sure about this one...
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
you can use a lua script to run a custom memory search function to find the offset. Examples: http://pastebin.com/Ei3KJKX4 (kirby super star ultra) You slide to the left - Kirby's speed becomes -704 - then you click somewhere to run the custom function that searches for addresses that have that value. Then chances are you have the offset for all other addresses that you need, as well. http://tasvideos.org/forum/viewtopic.php?p=414994#414994 (Yoshi's topsy turvy) Likewise procedure: walk left so yoshi's speed becomes -512, then do the search.
local speed=-512
local z=0
local memorys={}
 
function MSearch()
        for i=0,53000 do
                memorys[i]=memory.readwordsigned(0x02000000+2*i)
 
                if memorys[i]==speed then
                        z=2*i
                        break
                end
        end    
end

(...)

while true do

        Xspeed = memory.readwordsigned(0x02000000+z)
        Yspeed = memory.readwordsigned(0x02000000+z+4)
        Angle = memory.readbyteunsigned(0x02000000+z-22)

(...)

emu.frameadvance()
end
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
It is dependent on RNG. It changes in-battle only as enemies or you perform an action (how much it advances RNG depends on what action). Certain bosses such as Cackletta's soul use different attacks depending on health. The threshold seems to be if they're below half of their health. Oh, also, item drops for normal enemies are determined at the moment you touch the enemy in the overworld as far as I know. For certain enemies or bosses (not sure) it depends on if you kill them.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
I did not say that they are different. I'm just curious if they are.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Pow and Def bonuses differences of gear and badges are listed on themushroomkingdom.net but as for special effects (weight, healing etc) there doesnt seem to be a comprehensive list. Your guide lists them https://dl.dropboxusercontent.com/u/64507723/mlss_statguide.txt but I don't know what those terms mean "HP-Up Jump" or "Power-D" etc. I'm curious if those special effects have version differences too.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
So after a long break of not reading fanfic stories, I have picked it up again now (because, let's just say: I have nothing else to do). The story I read was this one http://www.fimfiction.net/story/68128/three-hundred-and-fifty (It plays before Twilicorn, canon-wise) Just saying, I'm kind of passionate about reading fanfics again. Does anyone else read any, and which ones? As for the ones I read before my break, I have a list somewhere... I'll also put ratings, because I did keep track of such. Most of those are probably just Scootaloo stories but I'm just putting it out there for curiousity sake. Also, I'm only listing the ones here that I feel special about.
Final Dream Of A Filly, by AmberWings (Donna-Drakain)  10/10
Things That Go South In The Night, by The_EE  5/10
Loss, by Caffum  9/10
Under Your Wings, by Askesalsa  5/10
The Warmth Under Your Wings, by Askesalsa  7/10 (Sequel to the above)
A Broken Bond, by Rated-R PonyStar  7/10
Transcendence, by Corejo  9/10
Our True Colors, by Donny's Boy  8/10
Not All Who Wander Are Lost, by RazedRainbow  10/10  (Unfinished)
Make A Wish, by Perpetual Lurker  8/10
A Little White Lie, by Samsara  9/10  (I don't know if this is our Samsara...)
Cutie Mark Clarity, by ladydestinae  8/10
Of Challenges and Kisses, by RavensDagger  9/10
The End of Ponies, by short skirts and explosions  10/10
Because someone in IRC did ask what was the pony-related thing I wanted to do, here is some information: Final Dream Of A Filly was a short fanfic story that has touched me greatly - it was the first one I have read just after I got into MLP and while you might think of it as another lousy Scootaloo is an orphan story I just can't help but have a special feeling for it. I have set it to my mind that I would make it into a comic. But since I lack the motivation and willpower to actually go draw it, it never took off. I had finished the first page and lineart for some more pages but I was not content with it so I stopped it. Now that Scootaloo has gotten her cutiemark it seemed to me like the story has become void. I particularly remember one part of the story that would not have worked out anymore: Applebloom telling Scootaloo that even if she does not find her special talent, she will go on looking for hers. I might or might not work on anything now. I don't really know. I haven't been feeling like even drawing simple pictures anymore, but lately I feel like my interest is returning. Maybe I will work on something and even if it's less than what I had in mind with Final Dream Of A Filly. Transcendence was another rather interesting one to me, although the author has decided to "tone it down a bit" and erased some moments that seemed to much over the top - which I find unfortunate but understandable. Not All Who Wander Are Lost is yet another big one to me. The author seems to have fallen victim to writer's block and has never finished it up, sadly... The End of Ponies... simply was too long for me to endure reading it. I read maybe the first third of it before I gave up on reading it - this being another unfinished story because the author said he is "not done with it" but he has not worked on it for over 3 years now - and does not respond to status questions... Unfortunate because this is an enormous heck of a fanfiction to say the least which sucks to see go unfinished like that. I could probably go and write something about all the other ones I listed but not right now. If someone wants me to I will though. It seems that I have a preference for stories that deal with death/separation/goodbyes/bittersweetness.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Did you confirm that the new lag emulation is more accurate to the real console? How come there are now graphical glitches during screen transitions? I don't think they are on the real console. Just asking because if the new emulation is indeed less accurate, that means you have switched to a worse emulator. Good job on the run itself.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
That's a lot of information to take in...
Attack formula wrote:
[max(1,greatforce*typeresist*[mushbonus + max(1,MovePower*[max(1,[2*pow-def/10])])])]]
What is greatforce (is it the coffee item? what does it do?)? What is typeresist? I assume mushbonus is the mushpower which is rounded down. pow is your pow? def is the enemy's def? I know that there must be a difference here between JP and English, since minimum damage in JP seems to be 2 instead of 1 - maybe that's the case only when doing Chopper Bros? I don't know. @jdaster As for the Stache thing, do I understand this right? There are 6 possible discount groups - it depends on the item. Then, there are 5 possible sell/buy constants - it depends on your stache. Right? While I think I could probably apply your code as is into lua, I would appreciate some elaborations. What do you mean "until next threshold"? What does the game do? I don't think there is a difference between US and EU but there might be between US/EU and JP. If possible, please do check for differences. @BioSpark: Where in the ROM (US version) is the calculation for mushpower? (what address)
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Alternatively you can edit out those Setclientextrapadding instances. I have not looked into how to get "warp to room" to work yet, those non-started N/A things are just wishful thinking that I would like to add but can't really promise. I will try. But "run event" will be similarly useful to you since you can also jump to certain points in the game with it.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
MLSS Script v0.4
- Config file: Improved all config-related code.
- Config file: Fixed that the Position Display and Snake Game would sometimes be placed in the top left when they're not supposed to.
- Mush Calculator: Fixed that the mushroom counts in the calculator would not default to the game's mushroom counts when the calculator was inactive.
- Change Font: Improved the look.
- Item Display: Added a close button.
- Position Display: Added a close button.
- Edit Position Display: Added a Moon jump option.
- Edit Position Display: Added a Walk through walls option.
- Bros Follow Path Display: Added a close button.
- Bros Follow Bath Display: Added option to connect both brothers with a line.
- Bros Follow Path Display: Added option to connect Follow path pixels with the back brother. This enables you to see the direction of offscreen follow path pixels when entering a new room.
- Edit Action Commands: You can now type in action command IDs and apply them directly, or reset action commands to zero, or set back-Mario to "hop on barrel" directly. Note: The latter may not work in VBA because of its console-inaccurate emulation.
- Snake Game: Fixed that the ending screen text was off screen with certain fonts. It should be good enough now with most fonts of sizes 8p to 10p.
Sorry, "Run event" isn't in the script yet. I had to push this update because I'm forced onto a hiatus and I won't be able to finish it in time. Will be in 0.5.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Is there a possible way to call out one of those to do a task? I checked avisynth (Probably not well enough, but couldn't get a result.
I don't think I understand your question. Also, in avisynth you don't need to write brackets, you can write clip.width instead of clip.width() or clip.converttorgb32 instead of clip.converttorgb32()
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Here is my keyboard macro run Link to video I had to splice it because the desyncs were too frequent. Levels 1,2,3,4,5,6,7 + 8 + 9 + 10. I tried to run this in Hourglass and it seems to work but I have not tested beyond that.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Ok so there is an out of bounds glitch in this game. Basicly, the game does not kill you if you "fall" into the depth when there is no adjacent tile. This is achieved by pressing two directions to go diagonally (as I said before). I'm about done with my experiment so I did not consider using this, but may be a timesaver. (Oh also, if you go off screen a certain distance (12 steps or so), your ball is gone forever)
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Info dump about event pointers:

ewram
--- Layer2 
4b6c     4byte    What should happen with the event. 
	          1 when event active 
                          0 when not active
                          11 when timer 
                          3 when searching for next valid event
                          5 waiting for a brother to reach a certain position
4b68  4byte      timer
4acc  4byte   pointer to the event

--- Layer1 
4ac4  4byte  active?
4ac0  4byte  timer 
4a24  4byte pointer to the event


---
#### JP:

todo:
- dragohoho
- get hammers
- get run away icon (battle)
- larry

2:0822de50 Panty Mario runs out the house

2:0820aec5 cruiser takes off

2:0820bf52 taking photo mario (too glitchy)

2:0820cc74 tutorial battle (goombas) #1   (pointless. Koopa tutor gone)

2:0820d51a tutorial battle (goombas #2 (pointless ". Game freezes after.)

2:0822edcf  rope game

2:0822f963 tolstar (spawn where you came from after battle, may try to run dialogue. May crash in some rooms?)

2:08230339  stardust field bros jump tutorial (fadein)

2:0823397f  orb game (broken. crashes emu)

2:08233c60 hohooros

1:dragohoho todo

1:hammers get todo

2:08234b4c fly onto the mountain / bowsers castle 

2:0826246b cartgame

2:0820da50 hammer tutorial battle  (pointless. Must have hammers otherwise softlocks.)

2:0823AA52 Bean Bean town Clothes shop (Buy)
2:0823AA8B Bean Bean town Clothes shop (Sell)

2:0823a9Ac Bean Bean town Item shop (Buy)
2:0823a9d8 Bean Bean town Item shop (Sell)

2:0823b1de Coffee screen

2:0823f7b5 enter sewers

1:0823fce4  queen bean   (spawns you where you were after, glitchy and may crash.)
 
2:0823e59c  badge tutorial   (freezes after)

1:08235a9f  popple and rookie battle (chuckola. freezes after)

1:08239192  chuckolator fight  (strange clip after, but otherwise ok. You are where you were after.)

2:08237227  barrel swim to castle and cure queen bean lol (after chuckola)

1:08243695  fade into university cackletta cutscene (when you open the gate. You spawn before the gate after.)

1:08244fee  cackletta fight (1st)  (you are where you were after. Messes up the room and may freeze depending on your position in the room.)
1:08244ffb   win

2:08246535   popple and rookie fight (university)   (you are where you were after. glitches the room but seems ok)

2:08246815   starbean flies out of university cutscene. you are at oasis after. functional

1:0825c7eb   university (starbean flies out)

fade into stardust field cutscene cackletta becomes bowletta:
  does not seem to work. Maybe depending on if you had watched it already
2:0826616c  (fade into)
1:0825cfdd   (blue text)

Prince Peasly did not appear after travelling to main land (after watching bowletta cutscene).

2:0824787b  mom piranha fight  (you are where you were after. functional)

2:082472bb   peach arrives in plane  
the throne room door may be closed depending how far you are in the game.

2:08225a6b   fade into beginning of peach escort (does not trigger the peach escort)

2:0826398e   enter yellow pipe towards peach prison chamber (upper exit is where you were.. may be glitchy)

---
2:5ec00548  <-- Peach Speech Glitch in VBA v24 svn391 but what really happens does not depend on the event pointer alone.
2:5ec01283 <-- Peach Speech Glitch in VBA v24 svn391 map screen right before clicking into the credits
2:5ec012bd (0) <-- fade
in VBA, a glitch event occurs immediately 
in VBA-Next, the event pointer is incremented until an event pointer that the game deems valid is set.
---

1:08226a2a  trunkle fight  (you are where you were after. May glitch up the room or crash depending on your position)

1:08226e39  lift to fungitown 

2:082239c1  fungitown item shop (Buy)
2:08223a00  fungitown item shop (Sell)

2:08224c32  fungitown clothes shop (Buy)
2:08224c71  fungitown clothes shop (Sell)

2:082238f8  yellow pipe into fungitown

2:0822482a   fungitown minigame
2:08224815 (11) fade
you are where you were after.
if it is the first time playing and you win, may cause glitchy behavior.

2:08224aa6  fade into mario is sick cutscene

2:08221463  fungitown room (peach kidnap cutscene)

2:08223b2d  mario room (where he is sick)

1:08224705  return to castle after fungitown (after peach kidnap)

2:08248d82  barreling game. (spawns you in the ship)

2:082492d5  ship going off shore (spawns you in the sea)

2:0821c0ef   fade into lagoons hand tutorial
untested what happens if already watched

1:0821ec4e  hermie 3 fight (freezes after)

1:0821ee8f  starbean piece get  (May glitch up or freeze.)

1:082125e5  fade from designer to caged starbean piece
(needs to set position after fading back:
   mario    luigi
x 33000 27000
y 74000 74000 )

2:08215263  piranha bean fight. may glitch up or softlock after. you are where you were after.

2:0824a0b7  popple fight (alone). freezes.

2:0824c8c4  jojora and girlfriend fight. you are where you were. softlocked but fine otherwise?

2:0824dc23   fade into luigi cruiser

2:0824eb4c   fade into luigi parachute. softlocks if you are controlling both bros. otherwise functional

2:082279d6  popple and birdo fight. freezes after

2:08211a55   enter bean bean town from the right

1:0823a517   trigger endgame (town broken down by bullet bills)

1:0823ef33   bowsers castle shoots bullet bills cutscene. spawns you in the castle, functional

1:0825ccf9   entering bowsers castle. functional

2:0824f426  leave bowsers castle. functional

2:0824f55f   watch koopalings getting released. spawns you in bowsers castle at the start (in wall but easy to get out)

2:0824fc0b   iggy fight  (may or may not crash)

2:0824fd68   spawn in front of iggy's room. may only work as both bros.

2:08250218  morton fight (may or may not crash)

2:08250372  spawn in front of morton room. may only work as both bros.

2:08251226  lemmy fight

2:0825134f   spawn in front of lemmy room

2:082525ca   ludwig fight

2:082526e0  spawn in front of ludwig room

2:0825356f   spawn in front of roy room

2:082536bb roy fight 

2:082542dd  wendy fight

2:082543cc spawn in front of wendy room

2:08254f8f  spawn in front of larry

2:08255423  fawful fight (bowsers castle)

2:08255fce  bowletta fight  (you go to cackletta soul after. you are where you were after cackletta soul. glitchy after.)

1:082563c5   fade into ending (bowsers castle crumbling)

1:0825d3b1   fade into plane cutscene (ending)

1:0825d496  fade into staff credits

2:0825d4ba  save game anywhere
2:0825c874  fadeout

2:08235071  make mario be full of water

2:08259403 enter green pipe map screen 
(needs to set the index to a previously visited green pipe
needs to do so about a second later.)

Trigger a battle anywhere:
Frame n:   2:FFFFFFFF(1) 
Frame n+1:   2:FFFFFFFF(3) 00000019
During the star animation, a valid event pointer for the battle
should be set. This works only for boss battles and some event
battles, since all other normal battles seem treated differently.


#### US:


to prevent crash after battle, use 2:08274bad
disable other layer.


2:08245870 Panty mario running out the house

1:08245f73  peach castle bomb voice boom

2:08222942  cruiser takes off

2:08223674   inventory tutorial  (crashes after)

1:08224694   battle tutorial (cruiser #1). may crash

1:08224f23   battle tutorial (crusier #2). may crash

2:0822732c   fade into on top of cruiser

1:08227c7c   fawful fight (cruiser)

1:082463d9   arriving in stardust fields

2:082467c7   rope game

2:08247d28   stardust fields tutorial

2:08248a29   return from stardust fields tutorial

2:08247357   tolstar

2:0824b625   hohooros

1:0824a797  dragohoho

2:08279498  cart game

2:08279b52  losing cart game

2:08228989  enter bean town from left

2:08252b46  coffee screen

2:082570f2   enter sewers

1:08257621  queenbean

2:082524bd bean item shop Buy  (cant move)
2:082524e9 bean item shop Sell

2:082523ba  bean cloth shop Buy (cant move)
2:082523f3   bean cloth shop Sell

1:0824d44a  popple and rookie (chuckola)

2:08250b03   chuckolator

2:0824ebd2   barrel swim back to castle

1:08255d41   queenbean gets cured

1:0825c8fb   cackletta (university)

2:0825de3a   popple and rookie (university)

2:0825e11a  starbean flies out of the house

2:08232ae2  make luigi into surfboard (not reliable at all)

2:082296ea  yellow pipe into sea (from main land)

2:0824ca2b  makes mario full of water

2:0825f180  mom piranha

2:0825ebc0  peach arrives in plane

2:0823d4df   peach escort start (does not trigger the escort unless peach is ready for the escort)

2:0827a9bb  enter yellow pipe to peach prison (upper exit is where you came from)

1:0823e49e  trunkle

1:0823e8ad   lift to fungitown 

2:0823b46f   fungitown item shop Buy (cant move)
2:0823b4ae   fungitown itemshop Sell

2:0823c6ae  fungitown cloth shop Buy (cant move)
2:0823c6ed  fungitown cloth shop Sell

2:0823b3a6   yellow pipe into fungitown

2:0823c2b0   fungitown minigame
you are where you were after.
if it is the first time playing and you win, may cause glitchy behavior.

2:0823c52b  fade to mario is sick room (cutscene)

2:08238f2f   bridge towards fungitown hospital

2:0823b5db   enter mario is sick room

1:0823c19d   to castle (cutscene after peach kidnapped)

2:08260674  barreling game

2:08231844  yellow pipe from sea to lagoons

2:08233bbb  hands tutorial (lagoons)

1:0823671a   hermie 3



2:08270aeb   green pipe screen (may be glitchy)

2:08274b9e  save anywhere




#### EU:

- not tested. May be the same as US or with an offset. 
1:234567 means layer 1. So the active?-address of layer 1 has to be 01 to start the event. And the event pointer address has to be the value. Then the event starts on the spot. Make sure that the active?-address for the other layer is not active. notes: - When an event is "active" and you are on the pause screen or in battle, it will not run until you unpause or finish the battle (win the battle). - When jumping to a boss battle, you are technically still in the room where you were. After the boss battle, you will be in that same room and the game may try to run a post-battle event which may glitch up if not in the room you're supposed to be. To fix this, make the event pointer address be certain value. This value is 0825d4c9 in JP (savescreen but does nothing when applied like this) so you effectively cancel all subsequent events. - I found European text relating to minigames in the Japanese and US version. (worthy of noting on tcrf?) - You can see the luigi changing from his peach outfit animation by moving his position. You can not normally see this animation otherwise (worthy of noting on tcrf?) - Iggy: You can clip into the wall and skip his spinning around and you losing your controls. Is a timesaver in speedruns, in case nobody knew. - Lemmy: He seems to be always fail first time you pound him or his clones. The 2nd time is RNG. 3rd and other times I didn't test but is probably RNG too. - Roy: You can skip him jumping away and touch him, but you will fight Morton instead of him. After beating him, you will be in the center of the room and softlocked.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
2. --> https://github.com/TASVideos/BizHawk/issues/525 I found a little graphical bug (?), also in memory watch. https://github.com/TASVideos/BizHawk/issues/526 edit: looks like you fixed it already. As for event.onexit, I don't know what is the real problem and how it should be. There seem to be differences between how mGBA and VBA-Next handle things. There seem to be differences in what happens if you a) double click a lua console entry (a script) b) drag and drop a lua script that was already running onto the console or onto the client c) click the refresh button in the console Maybe I'll come up with some kind of table of what I can observe. I feel like a) b) c) should all terminate the script and restart it completely, in all cases. Right now doing a) in VBA-Next seems to terminate the script properly whereas in mGBA it only suspends the script until you restart it. When doing b) in mGBA it creates an additional instance of the script that should not be there. These instances are terminated only when you close the console and reopen it. And doing c) in mGBA has a chance of causing an exception error.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
I'm trying to investigate running an event in Mario & Luigi from anywhere, so I'm editing some memory addresses. When I edit addresses a certain way Bizhawk seemingly always crashes. Does it not like illegal opcodes or what is the cause? It crashing every 2 minutes and me having to open up hex editor and give it the right settings (domain, size) again then going to the right address again is very time consuming and frustrating. If anyone wants to research it: --- Mario & Luigi RPG (J), VBA-Next core Stand around anywhere, without talking to anyone or being in an event already. Then edit: EWRAM $4b6c (4 bytes) needs to be 1 This starts an event. EWRAM $4acc (4 bytes) needs to be 0x08239488 (it is shown as 88 94 23 08 in the hex editor, 1 byte sizes) for Bizhawk to seemingly crash consistently. ----------------------------------------- In memory watch, when adding a new watch, then entering an address, then switching to a different domain erases the address I had typed in. Would be nicer to keep it in and trim if necessary. ----------------------------------------- In hex editor, size 1, click on an address and type in order to edit it. If you type a new value then the red marker advances to the next address accordingly. But if you type in the same value the address already had, then the red marker does not advance until you have typed in a value not equal to the one of the current address.
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
I don't know this game at all but if you're saying it's cutscene heavy, any chance on a cutscene-less encode?
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Ok, I have run a few tests myself and you have also convinved me. So I'm making the Settings table now as AdituV suggested. I'm getting a little confused about usage of "local" so: What's the best choice of these three, assuming "var" is only needed inside the function? a)
Language: Lua

local var local function=test() var=memory.read_s8(0x1234) end while true do test() emu.frameadvance() end
b)
Language: Lua

local function=test() var=memory.read_s8(0x1234) end while true do test() emu.frameadvance() end
c)
Language: Lua

local function=test() local var=memory.read_s8(0x1234) end while true do test() emu.frameadvance() end
Is there a difference between b) and c)?
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
The first code in my previous post is part of function GuiLoadSettings() and it occurs only once when you load the script. Doing expensive operations on a one time instance is ok. But the 2nd/3rd code runs every frame. And since you said doing a["string"] is slower, I will not go for it. The only way I see how I can do it is to change all the variables into numbers, so BoolBrosPath becomes value in a table for key "1", BoolNotifications becomes "2" etc. But then the code becomes highly confusing. So not going for that either. I think...
local SettingsTable={
[1]=false, -- BoolBrosPath
[2]=false, -- BoolNotifications
...}
^ Is that what you meant parsing it into a setting table? Thanks for the help so far
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Thanks. But I feel like this does not solve my problem much... I can shorten my 150 lines of code to 15, but will have to either a) introduce a table like you said but other functions will have to access it every frame. I feel like accessing a table by key string is much costlier than accessing a variable itself. or b) save a table but then go through that table to assign values to the stand alone variables anyway (so I would shorten my code but then lengthen it again). If you need an example of my code:
for line in settings:lines() do  -- finding the settings and assigning them to variables
			
			-- bools:
			if string.find(line,"BoolBrosPath") then 
				substringStart=string.find(line,"%:")+2
				substringEnd=string.len(line)
				substring=string.sub(line,substringStart,substrEnd)
				setting=toboolean(substring)
				
				if setting == nil then
					BoolBrosPath = GLOBALSETTINGS["BoolBrosPath"]
				else
					BoolBrosPath = setting
				end
				
			elseif string.find(line,"BoolNotifications") then 
				substringStart=string.find(line,"%:")+2
				substringEnd=string.len(line)
				substring=string.sub(line,substringStart,substrEnd)
				setting=toboolean(substring)
				
				if setting == nil then
					BoolNotifications = GLOBALSETTINGS["BoolNotifications"]
				else
					BoolNotifications = setting
				end
			
			elseif string.find(line,"BoolWarnings") then 
				substringStart=string.find(line,"%:")+2
				substringEnd=string.len(line)
				substring=string.sub(line,substringStart,substrEnd)
				setting=toboolean(substring)
				
				if setting == nil then
					BoolWarnings = GLOBALSETTINGS["BoolWarnings"]
				else
					BoolWarnings = setting
				end
				
			elseif ........

I can make a table like you said but then I would have to change this
...
while true do
...
if BoolBrosPath then drawBrosPath() end
...
into
...
while true do
...
if a["BoolBrosPath"] then drawBrosPath() end
...
so as said I'm worried if this causes a slowdown. Maybe if I use numbers, but then it gets confusing :)
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
Belated thanks :) And onto the next adventure:
if a="rex" then

  rex=true

elseif a="pig" then
 
  pig=true

elseif a="cat" then

  cat=true

end
I would like to write something like tovar(a)=true How can I do this?
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
MLSS Script v0.3
Note: This makes use of new Bizhawk lua function SetClientExtraPadding. Please update to Bizhawk 1.11.3 before using this script.

- Console Notifications: When you are on the title screen and turn on certain displays, you will now get notified that it will not be shown on the title screen.
- Snake Game: Fixed that you could move into your own body without dying when you held the opposite direction.
- Menu: Function drawMenu() has been rewritten, improving performance.
- Menu: Displays from the menus "Edit" and "Other" now also have an indicator if they are active or not.
- Menu: Functionality that hasn't been added yet is now noted in the menu as "N/A".
- Mush Calculator: The game version currently running is now indicated by a ^.
- Information: The script now automatically makes space. You do not have to stretch the client window down to make space anymore.
- You can now choose the GUI's font from a list. You can also install an 8p font of your choice and edit line 68 accordingly to use your own font.
- Edit Position: Fixed that the color of Mario's buttons was white instead of red when Luigi was in front.
- GUI Settings are now saved to a file config.cfg. This includes display's position, font setting and whether a display is active or not. When you reload the script, the settings are loaded from the file.
The file is saved every time you interact with the menu. When event.onext() stops being buggy in Bizhawk, I will make it so it saves onexit instead.

Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
event.onexit(function()

print("Script terminated.")

end)
This is supposed to run when the script is stopped. In mGBA or VBA-Next, when double clicking on the lua console entry of the script, it will run the above code block (but the script is not truly terminated in mGBA. It will only suspend the script until you unpause it, not exit it. This behavior does not happen in VBA-Next.) In mGBA or VBA-Next, when the script is active and then dragging the lua file on the lua console window it will exit the script but not run the above code block. (Also, whenever you do this, it will create additional instances see issue 513.)
Editor, Experienced Forum User, Published Author, Expert player (2315)
Joined: 5/15/2007
Posts: 3856
Location: Germany
For your information, Scare Master was already leaked on iTunes. It's floating around the internet now if you want to watch it.