It is currently 28 Mar 2024, 17:26

WELCOME TO SIMUSCAPE!


Please Sign in or Register to enable all features, remove restrictions and gain additional access!
For information on how to bypass the CAPTCHA or to contact Team Simuscape, Continue Here!


Post a new topicPost a reply Page 1 of 1   [ 9 posts ]
Author Message
PostPosted: 24 Aug 2012, 03:13 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
Questions or comments regarding this tutorial? This is the place to post them as a reply.

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 09:23 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 480
Location: The Netherlands
Absolutely fantastic work!!! :W
I have a couple of questions ...
(1) I've got an animation running with 6 frames, the animation runs fine, but I don't see the sprite I want in the menu. I see one of my animation frames there.

I did make some changes to the code, the major change was the removal of the additional text callback (cb15), as I don't need that. So maybe the GRF is a bit confused because I do still have the final action2 that refers to that. Or I messed something up adding the extra frames.
So the question is, could you take a look at what may be wrong and also what can be removed from the final action2 as I don't use the additional text callback:

Code:
  270 * 45       00 0F 0D 01 0C 08 "BCH3" 09 07 D0 0A 03 D0 0B 0F 0C 11 0D 02 0E D4 77 09 00 0F 00 00 20 00 10 40 00 11 05 01 12 06 13 01 00 17 01
  271 * 4        01 0F 06 01
  272 c:\grfmaken\grfcodecwin\beach/beach.pcx 20 620 09 100 64 -31 -73
  273 c:\grfmaken\grfcodecwin\beach/beach.pcx 90 620 09 100 64 -31 -73
  274 c:\grfmaken\grfcodecwin\beach/beach.pcx 160 620 09 100 64 -31 -73
  275 c:\grfmaken\grfcodecwin\beach/beach.pcx 230 620 09 100 64 -31 -73
  276 c:\grfmaken\grfcodecwin\beach/beach.pcx 300 620 09 100 64 -31 -73
  277 c:\grfmaken\grfcodecwin\beach/beach.pcx 370 620 09 100 64 -31 -73
  278 * 17       02 0F 00 00 8D 0F 00 00 00 80 00 80 00 00 0F 0F E5
  279 * 17       02 0F 01 00 8D 0F 00 00 01 80 00 80 00 00 0F 0F E5
  280 * 17       02 0F 02 00 8D 0F 00 00 02 80 00 80 00 00 0F 0F E5
  281 * 17       02 0F 03 00 8D 0F 00 00 03 80 00 80 00 00 0F 0F E5
  282 * 17       02 0F 04 00 8D 0F 00 00 04 80 00 80 00 00 0F 0F E5
  283 * 17       02 0F 05 00 8D 0F 00 00 05 80 00 80 00 00 0F 0F E5
  284 * 30       02 0F 06 81 43 00 FF 05 01 00 01 01 02 00 02 02 03 00 03 03 04 00 04 04 05 00 05 05 00 00
  285 * 17       02 0F 07 85 0C 00 FF FF 01 00 80 59 01 59 01 06 00
  286 * 4         01 0F 01 01
  287 c:\grfmaken\grfcodecwin\beach/beach.pcx 440 620 09 100 64 -31 -73
  288 * 17       02 0F 08 00 00 80 00 80 00 00 00 00 00 00 00 00 00
  289 * 23       02 0F 09 85 0C 00 FF FF 02 02 80 5C 01 5C 01 03 00 59 01 59 01 05 00
  290 * 10       03 0F 01 0C 01 FF 09 00 07 00
  291 * 1         0C


(2) A little bit more advanced, but what should one alter if one wants to have more views? So for example I would like 4 views (for the four rotational views, that is to use as few object-ID's as possible, because there are not that many objects-ID's available in the game).

(3) And this is maybe expert level ;-) But say I would like the animation to start at a specific time and let it end at a specific time (for example start in May end in September), how can that be done?

And again, many many thanks for this tutorial, it will enable me and others to make grf's even more interesting!!


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 12:23 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
Quast65 wrote:
Absolutely fantastic work!!! :W
:W

Quote:
I have a couple of questions, but I don't seem to be able to post in the Class Discussions, so I'll post them here.
Does the button on this page display with a lock?

Quote:
(1) I've got an animation running with 6 frames, the animation runs fine, but I don't see the sprite I want in the menu. I see one of my animation frames there.
You need to change the default value in the "Return to Graphics" code to that of the menu's Action2
Code:
From:
289 * 23       02 0F 09 85 0C 00 FF FF 02
       02 80 5C 01 5C 01
       03 00 59 01 59 01
       05 00
To:
289 * 23       02 0F 09 85 0C 00 FF FF 02
       02 80 5C 01 5C 01
       03 00 59 01 59 01
       08 00


Quote:
... and also what can be removed from the final action2 as I don't use the additional text callback:
Remove the reference to CB15C:
Code:
289 * 23       02 0F 09 85 0C 00 FF FF 01
       03 00 59 01 59 01
       08 00


Quote:
(2) A little bit more advanced, but what should one alter if one wants to have more views? So for example I would like 4 views (for the four rotational views, that is to use as few object-ID's as possible, because there are not that many objects-ID's available in the game).
1. In Action0 change the last property (17) from 01 to 04 (02 for two views)
2. For each view:
- repeat everything starting from the first Action1 to the end of the last Action 2 (Do not include the Action three when doing this.)
- Change the Action2 IDs so that they are all unique and different for each additional view.
- The simplest way to do this is to merge each Action (e.g. The first Action 1 might reference 12 real sprites instead of 3 and the menu Action1 would reference 4 sprites instead of 1).
3. You will now have 4 Animation Trigger Action2s and 4 Return to Graphics Action2s. New Action2s will be needed to assemble these for your menu:
Code:
  217 * 22    02 0F 9A 81 48 00 03  03
     89 00  01 01 // ID of 2nd Return to Graphics Action2
     8A 00  02 02 // ID of 3rd Return to Graphics Action2
     8B 00  03 03 // ID of 4th Return to Graphics Action2
     88 00 // ID of 1rst Return to Graphics Action2
  218 * 22    02 0F 9B 81 48 00 03  03
     63 00  01 01 // ID of 2nd Animation Trigger Action2
     64 00  02 02 // ID of 3rd Animation Trigger Action2
     65 00  03 03 // ID of 4th Animation Trigger Action2
     62 00 // ID of 1rst Animation Trigger Action2

4. Finally your Action3 should be changed to reference the IDs of these two new Action2s.


Quote:
(3) And this is maybe expert level ;-) But say I would like the animation to start at a specific time and let it end at a specific time (for example start in May end in September), how can that be done?
The simple answer is it can't. This would require the addition of a new option to Action0 property 13 Animation triggers (CB 159).

Quote:
And again, many many thanks for this tutorial, it will enable me and others to make grf's even more interesting!!
:W

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 13:52 
Artists Guild Team

Joined: 02 Mar 2012, 12:10
Posts: 75
Quast65 wrote:
[...]
(3) And this is maybe expert level ;-) But say I would like the animation to start at a specific time and let it end at a specific time (for example start in May end in September), how can that be done?

This would be possible by CB 159 (animation control). It allows to start/stop animation at a specific frame.

Problem is that objects have no specific animation triggers, except when the object is built and in the periodic tile loop, in contrast to e.g. industry tiles which have animation triggers for input/output cargo delivered/distributed.

Therefore, it would be quite difficult to base the control of an object´s animation on a certain TTD (date) variable, e.g. "play animation only in april", simply because the periodic tile loop will happen always, and several times, even during a specific TTD day, making it unlikely that both animation and game loop would be in synchronity. E.g., animation would be started multiple times during 1st of april, and the visual appearance will be depending on the speed of the animation.

The best way to work around this problem would be to run the animation continously, but show only a fixed animation frame (the last one of the previous time the animation was shown running) outside the appropriate timeframe, i.e. only *simulating* a stopped animation.

regards
Michael


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 14:42 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
mb wrote:
The best way to work around this problem would be to run the animation continously, but show only a fixed animation frame (the last one of the previous time the animation was shown running) outside the appropriate timeframe, i.e. only *simulating* a stopped animation.
Possible? Yes ... but there are several things to consider:
Consideration 1: How many 27ms ticks in a game day?
Consideration 2: How many game days between September and May?
Consideration 3: How to compensate for the leap year day in February?
Consideration 4: The object would have to built only in a specific month (In this case May).

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 15:41 
Player
Player
User avatar

Joined: 06 Mar 2012, 21:55
Posts: 480
Location: The Netherlands
Quote:
You need to change the default value in the "Return to Graphics" code to that of the menu's Action2

Ah, I see, that did the trick. Good to know what to alter when I add more animation steps and/or views.

Quote:
Remove the reference to CB15C:

Right, works! And also good to know what value should be changed if you add or remove callbacks (the 02 after the FF FF)

Thnx for explaining what to do when you want to add more views, will try that out later. :W

About the startingdate of the animation:
Good to see that Michael also joined this discussion, because I am curious how he got the marina to change during the summer/winter months. He somehow got this "simulation" of a stopped animation to work.
So this would indeed mean a lot of calculating to work out how fast the animation should run and how many steps there should be in that animation. And even more indeed with the consideration of the leapyear day. My admiration for the Marico GRF is ever increasing! Could you elaborate a bit more Michael on how you did that?


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 15:59 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
Quast65 wrote:
Could you elaborate a bit more Michael on how you did that?
Yes Michael ... please ... :)

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 16:40 
Artists Guild Team

Joined: 02 Mar 2012, 12:10
Posts: 75
["faking" animation control]
wallyweb wrote:
mb wrote:
[...] The best way to work around this problem would be to run the animation continously, but show only a fixed animation frame (the last one of the previous time the animation was shown running) outside the appropriate timeframe, i.e. only *simulating* a stopped animation.

Possible? Yes ... but there are several things to consider:
Consideration 1: How many 27ms ticks in a game day?
Consideration 2: How many game days between September and May?
Consideration 3: How to compensate for the leap year day in February?
Consideration 4: The object would have to built only in a specific month (In this case May).

Well, in my proposal above, things like these wouldn´t have to be considered. E.g., you´d only check for the month. If it´s "april" you´d show the "next frame" of the animation, and if not, you´ll show the last animation frame displayed when in "april". Only if it´s april again, you´d show the next frame, etc, pp.

Quast65 wrote:
Good to see that Michael also joined this discussion, because I am curious how he got the marina to change during the summer/winter months. He somehow got this "simulation" of a stopped animation to work. [...] Could you elaborate a bit more Michael on how you did that?

The marina in the current MariCo released isn´t animated at all, hence the graphical glitches, which are more prominent in OTTD than in TTDPatch (the latter does a more regularly screen refresh). So, for a clean solution in OTTD, it has to be animated, which would indeed quite a tedious work, given already the complexity of the non-animated version.

regards
Michael


Top
 Offline Profile  
 
PostPosted: 24 Aug 2012, 17:20 
Master Mentor
User avatar

Joined: 27 Feb 2012, 22:45
Posts: 1880
Location: Canada
mb wrote:
["faking" animation control]
Well, in my proposal above, things like these wouldn´t have to be considered. E.g., you´d only check for the month. If it´s "april" you´d show the "next frame" of the animation, and if not, you´ll show the last animation frame displayed when in "april". Only if it´s april again, you´d show the next frame, etc, pp.
I'll have to give this some thought. I may have a use for it if it can work. If anybody is looking for me, I'll be down in my laboratory ... Please send water and food ...

_________________
Visit SimuSchool - Tutorials, Questions and Answers
TTDPatch Nightlies Downloads are back
Thrive


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 9 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Status SimuscapeTerms of UseAbout Simuscape

Design by SAC © 2012-2015, Sweden • Powered by phpBB • Based on twilightBB by Daniel St. Jules