ChangeObjectState but graphic only 4.1.5 (solved)

mouse spirit

Well-known member
Can i somehow say ...
ChangeObjectState #$00,#$05

But without changing state?

Like.....
ChangeObjectState (nothing), #$05. ......basically
 

CutterCross

Active member
The full ChangeObjectState macro for 4.1.5 looks like this:
Code:
MACRO ChangeObjectState arg0, arg1
	;;arg1 what state to change the object to
	;;arg2 initial animation timer
	LDA Object_action_step,x
	AND #%11111000
	ora arg0
	STA Object_action_step,x
	LDA arg1
	STA Object_animation_timer,x
	LDA Object_animation_frame,x
	AND #%11111000
	STA Object_animation_frame,x
	;;;; We also need to update the vulnerability.
	LDA Object_state_flags,x
	ORA #%11000000
	STA Object_state_flags,x
	ENDM

You should be able to create a new macro that doesn't include the actual change state code, and only updates the animation timer. Possibly something like this:

Code:
MACRO ChangeObjectAnimationTimer arg0
	;;arg0 initial animation timer
	LDA arg0
	STA Object_animation_timer,x
	ENDM

Or just put that code directly wherever you want to use it (without the macro defines). It might be easier to just do it that way.
 

mouse spirit

Well-known member
Understood cutter. Great idea. I will work towards this. Mainly for my mega man style blocks but this should help with a few things.
 

mouse spirit

Well-known member
No, sorry.I get that, but also wouldnt it be simple to do this with a tile? Like i have been racking my brain, and can get tiles to change fine but only if i interact with them and not just the graphic, i change the whole tile. Like cant we make a simple timer or variable and say "tile type 07 be this graphic, now be this one, now this one" but using a timer and at certain times be switching the tile graphic?

I guess thats what im asking sorry, it was a little off topic.
 

mouse spirit

Well-known member
Such as....

Make a variable that starts at 61.
Code:
DEC variable each time this code runs
If variable equals 60, change graphic
If variable equals 40, change graphic
If  variable equals 20, change graphic
If variable equals 01, make variable 61
else do nothing(we did DEC at the top though)
Loop
 

dale_coop

Moderator
Staff member
Take a look at how the door tile changes its graphics (to another one, --yeah, an empty one, but's a graphic tile-- when the player touches it, with a key.
 

Mugi

Member
animating tiles using the changetile macros and a timer can be done, however, that's extremely not recommented due to the laggyness it causes, how it completely messes up with scrolling, and the fact that basically the only feasible way to do it is to change all the tiles of that type, which means not only you permanently lose a metatile from the chr for this, but also a tiletype.

i made animated tiles by using vblanktimer and the tilechange routines way back when i started developing my game and it's definitely doable but absolutely not feasible for gameplay; at most it could be used for simple animation for a static screen like a win screen or something.

doesnt the new nesmaker version include tile animation routines through chr-ram now ? i was under the impression that this was one of the oh-so-hyped updates to the tool.
 

dale_coop

Moderator
Staff member
The current version of NESmaker comes with a basic almost empty core. So you can't do all those advanced things... (yet?)
 

mouse spirit

Well-known member
Much appreciated. Both of you,thank you. I know i dont need animated tiles but sometimes i really want one. I will still try to find a work around then. I will study.the lock script also.
 

mouse spirit

Well-known member
I just want some decent freakin torches that arent monsters! Maybe something close woild be a foward then reverse palette swap. That way a flame goes up n then a flame goes down.
 

CutterCross

Active member
Mugi said:
doesnt the new nesmaker version include tile animation routines through chr-ram now ? i was under the impression that this was one of the oh-so-hyped updates to the tool.

At this point I expect Joe to just forget about the whole thing and call it an "advanced feature." Tbh I just want to know what data the tool exports for the unused Special Tiles section, if anything at all.

mouse spirit said:
Much appreciated. Both of you,thank you. I know i dont need animated tiles but sometimes i really want one. I will still try to find a work around then. I will study.the lock script also.

The most feasible way to do proper animated tiles is to use Mapper#30's CHR RAM bankswitching. That's one of the strengths of this mapper, along with flash saving capabilities etc. The issue is that nobody in the NESmaker community has shared a good method that doesn't require deep understanding of how CHR RAM bankswitching works. At this point it's something you can only do with deep knowledge of assembly language, NES hardware, and the mapper you're using. But it is absolutely an option.
 

mouse spirit

Well-known member
Understood. So, last question then. Is it true that if i somehow get rid of the night and night triggered states,
That i could have more objects on screen without lag?
Because i read somewhere that we could have more but because the game is having to pay attention to 4 monsters for each day,day trig,night,night trig all the time.
Is this true at all? That would allow me to have more animated stuff on screen, understanding there is still a limit before stuff disappears because of horizontal sprite limits or whatever.
 

CutterCross

Active member
mouse spirit said:
Understood. So, last question then. Is it true that if i somehow get rid of the night and night triggered states,
That i could have more objects on screen without lag?
Because i read somewhere that we could have more but because the game is having to pay attention to 4 monsters for each day,day trig,night,night trig all the time.
Is this true at all? That would allow me to have more animated stuff on screen, understanding there is still a limit before stuff disappears because of horizontal sprite limits or whatever.

No.

Aside from the fact that Night and Night Triggered states aren't really implemented in 4.1.5, (I think the same would be for the current 4.5 modules but I can't vouch for that.) each monster for each state isn't being tracked in Object RAM at once. During screen load, the game checks if the screen is triggered or not, and loads each monster + starting position depending on what trigger state the screen is in. Only the actively loaded monster / game objects and their respective object variables are tracked in Object RAM.
 
Top Bottom