4.0.11 UPDATE!

RadJunk

Administrator
Staff member
CODE UPDATE 1: AddValue macro

There are a few things that might be affected if you update rom 4.0.6 to 4.0.11. The most overt of these is the following:

Any code which uses the macro AddValue or SubtractValue will have to be updated. In the tutorial, one such piece of code was the Powerup_IncreaseMoney.asm script (another being the increase score script). If you get any error that mentions the AddValue or SubtractValue script, you need to navigate to the file it told you the error was in. The fix is very easy.

The old routine would have said something like:

Code:
AddValue #$03, myVariable, #$01

This is a macro function that told the engine to add value to a multi-byte variable. The three arguments tell it:

arg0 - #$03 ... this told it that the variable you were going to update has 3 places (ones, tens, hundreds)
arg1 - myVariable ... this is the name of the variable that you want to update
arg2 - #$01 ... how much do you want to increase the number by? (0-9)

The NEW routine adds an extra argument:

Code:
AddValue #$03, myVariable, #$01, #$00

arg3 - #$00 ... this tells it what "place" to update. If it is zero, it updates the ones place. If it is one, it updates the tens place. If it is two, it updates the hundreds place. Etc, etc, etc.


If you add a comma, and the intended place to update as the next argument, that should fix this error.
 

TurtleRescueNES

Active member
What's the recommended way to move a 4.0.6 project over to 4.0.11?

Do we unzip 11 to establish itself, then move over our 06 project folders?

Or at this stage, should we just start over with a new project and try to import what assets we can through the utility?
 

RadJunk

Administrator
Staff member
Hard to say. You probably want the code-pack that is in 4.0.11. The instructions to do that are provided on the site.

But I'd ALWYAS make an archive :)
 

stevenshepherd

New member
TheNew8bitHeroes said:
Hard to say. You probably want the code-pack that is in 4.0.11. The instructions to do that are provided on the site.

But I'd ALWYAS make an archive :)

It looks like the instructions for 4.0.6 and 4.0.11 both say "This code package is expressly designed for NESmaker V.4.0.6..." and appear to be the same instructions?
 

RadJunk

Administrator
Staff member
It should say "current version"...it's possible that instruction pack never got updated in all the right places to say the current version. Sorry about that! haha
 

stevenshepherd

New member
ok cool thanks :) I got a compile error trying to run my adventure game from 4.0.6 in 4.0.11, so I'll dig around a little more here and on FB to figure out why :)
 
Hi, the $ thing worked, as we were having many issues at first testing our game. Though we are now encountering multiple problems.

We have copied our entire project including Graphic Banks over to the 4.0.11. That works fine. After changing the $ code thing, whenever we made a change to the game and test/exported it, the updates would not be there. New graphics made appear in the graphics bank but not on the test.
We tried changing back to the default emulator, though that resulted in the game refusing to load, at all.
Please help! :?
Thanks
QFBB Team.
 

Bucket Mouse

Active member
Guess I'm permanently using 4.0.6 for the adventure game.

I moved my game to 4.0.11 last night and it worked fine. Turned it on today and it wouldn't compile. I tried everything -- redownloaded the software, etc. Still won't run. All I know is it worked yesterday and now it doesn't work today, for no reason at all. Ghosts is my best guess.
 

Rob Burrito

New member
For anyone starting in 4.0.11, i ran into a mysterious error when upgrading. i tried pulling assets from my completed 4.0.6 tutorial to a new project in 4.0.11 with the handy new import/export feature to speed things up. here's the file to pull from that you didn't have in the video: View attachment Export Import.zip
here's what i found step by step:

00- Open 4.0.11, File\New\blank tileset\load adventure module\enter name 'tutorial project'. then setup the emulator.

01- Copy/pasted tutorial graphic assets to the newly created 'tutorial project' graphic assets folder in the 4.0.11 graphic assets folder.

02- Overworld\map\import both maps. **DO NOT DO THIS! START SCREENS FROM SCRATCH FOR NOW** covers overworld and underworld in one export. dont let the screen fool you though, it shows the correct screens but you will have to assign palettes. if you click to a particular screen to edit it will display all grey! this led me to create and assign the overworld and underworld palettes and palette groups. had the last project open so that was easy. reassigned the assets\special tiles as they did not copy over.

03- Manually set HUD box areas and elements from previous (would be nice if this exported)

04- Imported monsters via clicking monsters folder then Monster\import monster\select monster\save. you will need to manually set the palettes, but it already set these to each already on their own palettes, and the first or second pallete selection was retained as well. until we can import palettes it's really not too bad. had all monsters setup in about 7 minutes. but i was looking at the old project too for reference. there is an option to import export in the monster palettes, but i could only get them to appear in the background palette groups. if there is a way to export/import the monster palettes let me know! once monster palettes are set remember they wont update on your folder display until you click on/off of each one, but if you do them in order the assignments are still there! was nice to not have to reassign them all.

05- Reassigned Monster Groups. easy now that the monsters were done so quick. went to my screens and loaded the monster groups to the desired screens. any you forget in testing will show the player object as the monster (dont forget triggered states for assigning monster groups!)

06- Imported game object files. this one is alittle different than the monsters, as you have to select the game object slot you would like to import it to before importing. it does not save which slot it originially went in, so that's why i labeled them in order in the folder in case you forget.

07- Project\Info\ selected the first to items and skip start screen.

08- Added scripts and assigned them within the input editor. exported to a folder that i included.

09- Loaded sounds from the beta assets folder.

0A- as mentioned on here old assets might need updated, the error that came up on the first test was that one mentioned. went to project settings\script settings\ PowerUp 03 Routines\UserScripts\AdventureGame_Base\PowerUpCode\Powerup_IncreaseMoney and added the extra #$00 in the script editor.

0B- updated the text boxes for NPC's, back to playable! there was a SFX error though and would freeze every time i got hit. commented out the Adventure_HandlePlayerHurt.asm ;PlaySound #SFX_PLAYER_HURT, and then was playable with player health working. think i remember that happening in the tutorial. when i got to the boss found immune to weapon state caused the same problem, so went to Adventure_HandleHurtMonster and commented out ;PlaySound #SFX_MISS. have to figure out how to reassign to the right sounds, reassigning them through the SFX selector wasn't working to fix it (from clicking on SFX in your project tree)

**

noted a few things not perfect about it, but got me really close in under two hours to where i was at. pretty handy feature! i can't recommend importing/exporting maps for things to work correctly yet, as some special tiles dont behave properly. here are the things i noted strange about doing it this way, any input appreciated!

-locked door tiles work as normal, until in the triggered state do not warp as they did in untriggered, or as in the 'unimported' version. a new asset of the locked door acts the same. will warp with key in untriggered, but not once it is triggered.

-breakable blocks seem to be not copying correctly. they do not become walkable once hit. deleted the blocks on the overworld screen and made a new asset, replaced and same result of not working.

-monster lock tiles work fine
 

bakerguy85

New member
I'm really lost. I started a brand new Adventure game on 4.0.11 and it won't open. I've tried replacing the line of code and I still get an error?
 

bakerguy85

New member
dale_coop said:
Strange it should work.
What are your compilation errors (in the command line)?

This is what it says.
40650616_304117083505943_8018958066256969728_n.png
 

dale_coop

Moderator
Staff member
In the "Powerup_IncreaseMoney.asm" script:
- At line 9, you need to change:
Code:
AddValue #$03, myMoney, #$01
by
Code:
AddValue #$03, myVariable, #$01, #$00

- And at line 22... you shoud NOT have again
Code:
AddValue #$03, myMoney, #$01
You can comment this line (putting ; ; before the line)
Like this:
Code:
;;AddValue #$03, myMoney, #$01
 

bakerguy85

New member
dale_coop said:
In the "Powerup_IncreaseMoney.asm" script:
- At line 9, you need to change:
Code:
AddValue #$03, myMoney, #$01
by
Code:
AddValue #$03, myVariable, #$01, #$00

- And at line 22... you shoud NOT have again
Code:
AddValue #$03, myMoney, #$01
You can comment this line (putting ; ; before the line)
Like this:
Code:
;;AddValue #$03, myMoney, #$01

I'm really sorry, I'm not really undesrstanding. Coding isn't really my thing. Here is how the ASM looks.


Code:
;;; blank powerup code

    LDA myMoney+2
    CLC
    ADC #$01
    CMP #$0A
    BCS noMoreMoney
    
    AddValue #$03, myVariable, #$01, #$00
    

;;;;;;;;;;;;; UPDATE HUD

        
        LDA #$01 ;; amount of score places?
        STA hudElementTilesToLoad
        LDA DrawHudBytes
        ORA #HUD_myMoney
        STA DrawHudBytes
        
;;; trigger screen so it enteres triggered mode
;; and you can't continue to get the key again
    
    ;TriggerScreen screenType
    
noMoreMoney:
    PlaySound #SFX_GET_COIN
 

dale_coop

Moderator
Staff member
Ok, I see...
The script your are compiling is not the script you have modified.
Your project uses the script from the "AdventureGame_Base" module folder (look at the complete filename/folder name in the command line)
I suppose you made a copy in the platform module folder and modified the copy, right?

So just re-assign the right one... in your "Project Settings > Script settings", in the list, search for the PowerUp_Money (don't remember the exact name, sorry... I am not at home) and the script assigned to the one you modified.
 

bakerguy85

New member
I tried replacing some code and saving it and if it didn't work just did an undo and resaved. The code for this is in the right folder, and it's all there on the script settings, with the same lines.
 

dale_coop

Moderator
Staff member
So, just open the "Powerup_IncreaseMoney.asm" script, in your "nesmaker_4_0_11_platformula\GameEngineData\Routines\UserScripts\AdventureGame_Base\PowerUpCode" folder, modify the AddValue line, like that:
Code:
;;; blank powerup code

	LDA myMoney+2
	CLC
	ADC #$01
	CMP #$0A
	BCS noMoreMoney
	
	AddValue #$03, myMoney, #$01, #$00
	

;;;;;;;;;;;;; UPDATE HUD

		
		LDA #$01 ;; amount of score places?
		STA hudElementTilesToLoad
		LDA DrawHudBytes
		ORA #HUD_myMoney
		STA DrawHudBytes
		
;;; trigger screen so it enteres triggered mode
;; and you can't continue to get the key again
	
	;TriggerScreen screenType
	
noMoreMoney:
	PlaySound #SFX_GET_COIN

It should work.
 

bakerguy85

New member
dale_coop said:
So, just open the "Powerup_IncreaseMoney.asm" script, in your "nesmaker_4_0_11_platformula\GameEngineData\Routines\UserScripts\AdventureGame_Base\PowerUpCode" folder, modify the AddValue line, like that:
Code:
;;; blank powerup code

	LDA myMoney+2
	CLC
	ADC #$01
	CMP #$0A
	BCS noMoreMoney
	
	AddValue #$03, myMoney, #$01, #$00
	

;;;;;;;;;;;;; UPDATE HUD

		
		LDA #$01 ;; amount of score places?
		STA hudElementTilesToLoad
		LDA DrawHudBytes
		ORA #HUD_myMoney
		STA DrawHudBytes
		
;;; trigger screen so it enteres triggered mode
;; and you can't continue to get the key again
	
	;TriggerScreen screenType
	
noMoreMoney:
	PlaySound #SFX_GET_COIN

It should work.

That worked! Thank you so much!
 
Top Bottom