Animated props (eg flames or water ripples)

Any documentation, tutorials, tips and tricks, or examples on how to use the IB2 Toolset

Animated props (eg flames or water ripples)

Postby youngneil1 » Thu Apr 13, 2017 4:16 pm

The follwoing properties of a prop let you control its main map animation (all in code already):

"maxNumberOfFrames":1
Setting this value to anything above one indicates an animated prop. The engien will assume as many animation stages (frames) as you define here.

"updateTicksNeededTillNextFrame": 100.0,
The speed of the animation. A higher number means slower here. If you want e.g. have an animation at double speed set this to 50.

"chanceToTriggerAnimationCycle": 100.0,
The chance that the animation is started (and restarted). Lower means you will see the animation happen less often over time. 100 means a continous animation, repeating itself all the time.

"propFrameHeight": 100,
The y height of one anmation frame. Usually this is 100 pixels (e.g. creatures in combat with 2 frames are 100x, 200y). But for large or small token/sprites you can adjust the size accordingly here. Please not ethat propFrameHeight multiplied with maxNumberOfFrames should equal the full y height of your sprite sheet.

"sizeFactor": 100,
This determines you much you want to enlarge or shrink the animation onscreen. A value of 200 e.g. would doubel x and y dimension of the animation,. dispalying it over four map squares instead of one. Please note that you always place the top left corner of the animation in toolset.

"doOnce": false,
This animation runs only once (unless reactivated via script).

"animationIsActive": true,
Turn animation on and off.

"hiddenWhenComplete": false,
The animation (and therewith the whole prop) is invisible when it's not currently running through an animation cycle.

"hiddenWhenNotActive": false,
The animation (and therewith the whole prop) is invisible when it's not currently active.

"framesNeededForFullFadeInFadeOut": 15
This determines how swiftly your animated prop fades in and out after all frames have been done (numberOfCyclesNeededForCompletion * maxNumberOfFrames). When set to 0 (default), there's no fade in or out. The higher, the more slowly the fading happens. Please do not enter a number higher than half of (numberOfCyclesNeededForCompletion * maxNumberOfFrames). E.g. 15 framesNeededForFullFadeInOut feels quite nicely if you need avalue for orientation.

"numberOfCyclesNeededForCompletion": 25
This determines how many times you want the animation to repeat before it is considered complete. DoOnce will only register once all cycles have been done. ChanceToTriggerAnimationCycle will trigger the number of cycles specified here.


[WIP]
User avatar
youngneil1
Backer
Backer
 
Posts: 4093
Joined: Sat Dec 08, 2012 7:51 am

Re: Animated props (eg flames or water ripples)

Postby youngneil1 » Fri Apr 14, 2017 6:55 am

Ran into a potential bug with multiple animated props here, investigating...
User avatar
youngneil1
Backer
Backer
 
Posts: 4093
Joined: Sat Dec 08, 2012 7:51 am

Re: Animated props (eg flames or water ripples)

Postby youngneil1 » Fri Apr 14, 2017 7:09 am

.. and fixed (actually, it was just me not changing to unique tags after duplicating a prop).
User avatar
youngneil1
Backer
Backer
 
Posts: 4093
Joined: Sat Dec 08, 2012 7:51 am

Re: Animated props (eg flames or water ripples)

Postby youngneil1 » Fri Apr 14, 2017 7:40 am

Prop animations work great from what I see.Still, I need to make them play when seen from neighbouring maps, too. This might get a bit tricky...
User avatar
youngneil1
Backer
Backer
 
Posts: 4093
Joined: Sat Dec 08, 2012 7:51 am

Re: Animated props (eg flames or water ripples)

Postby youngneil1 » Fri Apr 14, 2017 10:00 am

... and done, works across neighbouring maps, too, now :) .
User avatar
youngneil1
Backer
Backer
 
Posts: 4093
Joined: Sat Dec 08, 2012 7:51 am


Return to Users Guide and Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron