From 0c9eeebe2b95dd39cdb768d1473a2766495d132a Mon Sep 17 00:00:00 2001 From: tibetiroka Date: Sun, 23 Jun 2024 13:47:24 +0200 Subject: [PATCH 1/9] things --- wiki/CreatingMissions.md | 9 +++++---- wiki/CreatingSubstitutions.md | 2 +- wiki/MapData.md | 13 +++++++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/wiki/CreatingMissions.md b/wiki/CreatingMissions.md index e52522f..2fe09f1 100644 --- a/wiki/CreatingMissions.md +++ b/wiki/CreatingMissions.md @@ -225,6 +225,7 @@ These placeholders will be substituted in any text in the following places: * the mission description * dialog messages contained in the mission * conversations contained in the mission +* custom substitutions defined in the mission **(v. 0.10.9)** For example, the mission description might be, "Deliver `` to `` by ``." @@ -662,7 +663,7 @@ If you want to retrieve passengers or cargo by boarding a ship, set up the missi ship ``` -This specifies a single ship as an NPC. The first argument is the model type (or named variant), such as "Falcon", or "Star Barge (Armed)". The second is the ship's name. +This specifies a single ship as an NPC. The first argument is the model type (or named variant), such as "Falcon", or "Star Barge (Armed)". The second is the ship's name. Beginning in **v. 0.10.9**, phrases and substitutions are expanded NPC ship names. If you want to customize an NPC (for example, having it start out with a particular cargo), you will need to define a variant of the ship and then reference that variant here. Placing the entire ship definition within the NPC definition is supported (because that is how NPC ships are loaded from a saved game) but will not work properly if the ship definition contains any outfits that are not defined yet when the mission definition is parsed. When loading NPCs from saved games, the rest of the game data has finished loading, but this is not otherwise guaranteed. @@ -753,7 +754,7 @@ dialog phrase This gives a message to be displayed in a dialog message to the user. If the trigger is `on offer`, the dialog will have "accept" and "decline" buttons. Otherwise, it is a purely informational message and only an "okay" button is shown. -Each token following the `dialog` tag will be a separate paragraph. The first token may appear either on the same line or indented on a subsequent line. +Each token following the `dialog` tag will be a separate paragraph. The first token may appear either on the same line or indented on a subsequent line. Beginning in **v. 0.10.9**, each line can also be given a `to display` node with a [condition set](Player-Conditions). `dialog phrase` can be used to create a single phrase that is used for multiple dialogs, instead of needing to copy and paste the same dialog over and over again. An example of where this is used in game is for `on visit` dialogs. @@ -784,13 +785,13 @@ If the outfit cannot be installed due to lack of space, a warning message will b The `require` keyword checks that the player has at least one of the named outfit, but does not take it away. For example, this could be used in the `on offer` phase to only offer a mission to players who have a "Jump Drive". Starting with **v. 0.9.9**, a specific quantity can be required, including 0 (i.e. the player cannot have any). If a non-zero quantity is specified, then the player's flagship is checked alongside the cargo holds of all in-system escorts, or only the flagship's cargo if this is a boarding mission. If a quantity of zero is specified, then the player cannot have that outfit anywhere on any of their ships. -Beginning in **v. 0.9.15**, if the outfit being gifts has the "map" attribute, then the player will be given the information from that map as if they had purchased it from the outfitter. If an outfit with the "map" attribute is being required by a mission and the required value is 0, then the player must have the nearest systems that match the size of the map outfit unvisited, but if the required value is greater than 0 then the nearest systems must be visited. +Beginning in **v. 0.9.15**, if the outfit being gifted has the "map" attribute, then the player will be given the information from that map as if they had purchased it from the outfitter. If an outfit with the "map" attribute is being required by a mission and the required value is 0, then the player must have the nearest systems that match the size of the map outfit unvisited, but if the required value is greater than 0 then the nearest systems must be visited. ```html give ship [] ``` -Starting in **v. 0.9.13**, missions can gift ships to the player. The named ship model is given to the player. This ship model can be a [ship variant](https://github.com/endless-sky/endless-sky/wiki/CreatingShips#variants). It is optional that the given ship has a name, but if no name is provided then a random name will be generated from the civilian phrase. +Starting in **v. 0.9.13**, missions can gift ships to the player. The named ship model is given to the player. This ship model can be a [ship variant](https://github.com/endless-sky/endless-sky/wiki/CreatingShips#variants). It is optional that the given ship has a name, but if no name is provided then a random name will be generated from the civilian phrase. Beginning in **v. 0.10.9**, substitutions and phrases are expanded in gift ship names. ```html (give | take) ship [] diff --git a/wiki/CreatingSubstitutions.md b/wiki/CreatingSubstitutions.md index 93fb986..aa7abe4 100644 --- a/wiki/CreatingSubstitutions.md +++ b/wiki/CreatingSubstitutions.md @@ -23,7 +23,7 @@ The three types of substitutions, hardcoded, mission-specific, and global, have ``` -Substitutions simply search for the text on the left and replace it with the text on the right whenever it is found within a piece of text. As mentioned above, multiple replacements of the same text can be defined, but whichever replacement is evaluated last is the one that gets used. +Substitutions simply search for the text on the left and replace it with the text on the right whenever it is found within a piece of text. As mentioned above, multiple replacements of the same text can be defined, but whichever replacement is evaluated last is the one that gets used. Beginning in **v. 0.10.9**, substitutions can contain phrases and other substitutions as well. A substitutions node can define multiple text replacements at once. diff --git a/wiki/MapData.md b/wiki/MapData.md index ec683b2..350d5ed 100644 --- a/wiki/MapData.md +++ b/wiki/MapData.md @@ -471,13 +471,22 @@ The [music](#ambient-music) that is played while landed on this planet. description ``` -The description that is shown when first landing on a planet. +The description that is shown when first landing on a planet. Beginning in **v. 0.10.9**, each line can also be given a `to display` node with a [condition set](Player-Conditions): +```html +description "This planet is a very nice place." + to display + not "terrible things happened" +description "Frog People invaded and the planet is now almost devoid of life." + to display + has "terrible things happened" +``` + ```html spaceport ``` -The description of the spaceport after clicking the spaceport button. +The description of the spaceport after clicking the spaceport button. Beginning in **v. 0.10.9**, each line can also be given a `to display` node with a [condition set](Player-Conditions). ```html port [] From e8192accbda62223da40e07dc1ecd3ad95a6eeac Mon Sep 17 00:00:00 2001 From: tibetiroka Date: Mon, 24 Jun 2024 10:01:27 +0200 Subject: [PATCH 2/9] mh --- wiki/CreatingMissions.md | 5 ++--- wiki/CreatingSubstitutions.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wiki/CreatingMissions.md b/wiki/CreatingMissions.md index 2fe09f1..00c8b6d 100644 --- a/wiki/CreatingMissions.md +++ b/wiki/CreatingMissions.md @@ -225,7 +225,6 @@ These placeholders will be substituted in any text in the following places: * the mission description * dialog messages contained in the mission * conversations contained in the mission -* custom substitutions defined in the mission **(v. 0.10.9)** For example, the mission description might be, "Deliver `` to `` by ``." @@ -663,7 +662,7 @@ If you want to retrieve passengers or cargo by boarding a ship, set up the missi ship ``` -This specifies a single ship as an NPC. The first argument is the model type (or named variant), such as "Falcon", or "Star Barge (Armed)". The second is the ship's name. Beginning in **v. 0.10.9**, phrases and substitutions are expanded NPC ship names. +This specifies a single ship as an NPC. The first argument is the model type (or named variant), such as "Falcon", or "Star Barge (Armed)". The second is the ship's name. If you want to customize an NPC (for example, having it start out with a particular cargo), you will need to define a variant of the ship and then reference that variant here. Placing the entire ship definition within the NPC definition is supported (because that is how NPC ships are loaded from a saved game) but will not work properly if the ship definition contains any outfits that are not defined yet when the mission definition is parsed. When loading NPCs from saved games, the rest of the game data has finished loading, but this is not otherwise guaranteed. @@ -791,7 +790,7 @@ Beginning in **v. 0.9.15**, if the outfit being gifted has the "map" attribute, give ship [] ``` -Starting in **v. 0.9.13**, missions can gift ships to the player. The named ship model is given to the player. This ship model can be a [ship variant](https://github.com/endless-sky/endless-sky/wiki/CreatingShips#variants). It is optional that the given ship has a name, but if no name is provided then a random name will be generated from the civilian phrase. Beginning in **v. 0.10.9**, substitutions and phrases are expanded in gift ship names. +Starting in **v. 0.9.13**, missions can gift ships to the player. The named ship model is given to the player. This ship model can be a [ship variant](https://github.com/endless-sky/endless-sky/wiki/CreatingShips#variants). It is optional that the given ship has a name, but if no name is provided then a random name will be generated from the civilian phrase. ```html (give | take) ship [] diff --git a/wiki/CreatingSubstitutions.md b/wiki/CreatingSubstitutions.md index aa7abe4..93fb986 100644 --- a/wiki/CreatingSubstitutions.md +++ b/wiki/CreatingSubstitutions.md @@ -23,7 +23,7 @@ The three types of substitutions, hardcoded, mission-specific, and global, have ``` -Substitutions simply search for the text on the left and replace it with the text on the right whenever it is found within a piece of text. As mentioned above, multiple replacements of the same text can be defined, but whichever replacement is evaluated last is the one that gets used. Beginning in **v. 0.10.9**, substitutions can contain phrases and other substitutions as well. +Substitutions simply search for the text on the left and replace it with the text on the right whenever it is found within a piece of text. As mentioned above, multiple replacements of the same text can be defined, but whichever replacement is evaluated last is the one that gets used. A substitutions node can define multiple text replacements at once. From 844153260ab742a167ce05e339fb1a6cff0e586a Mon Sep 17 00:00:00 2001 From: tibetiroka Date: Mon, 24 Jun 2024 10:12:42 +0200 Subject: [PATCH 3/9] Update CreatingMissions.md --- wiki/CreatingMissions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wiki/CreatingMissions.md b/wiki/CreatingMissions.md index e52522f..e579891 100644 --- a/wiki/CreatingMissions.md +++ b/wiki/CreatingMissions.md @@ -727,6 +727,14 @@ There are eleven events that can trigger a response of some sort: * `daily`: every time the date advanced (every jump between systems and departure from a planet). (**v. 0.9.15**) * `disabled`: if the player's flagship becomes disabled. (**v. 0.10.3**) +Beginning in **v. 0.10.9**, most of these triggers will not activate when the mission is already failed. In some cases, it still might be useful to keep track of the player until they land even if the mission failed. In these cases, you can make the triggers work by using `"can trigger after failure"`. +```html +on disabled + "can trigger after failure" + ... +``` + + Beginning with **v. 0.9.9**, the `enter` action supports determining the system with a [location filter](LocationFilters). This filter is formatted in the same manner as `source` or `destination` for missions, or `system` for NPCs. ```html on enter From 7a4698235e7204702d957ead7135d34d90eb19dd Mon Sep 17 00:00:00 2001 From: tibetiroka <68112292+tibetiroka@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:38:09 +0200 Subject: [PATCH 4/9] Update wiki/CreatingMissions.md Co-authored-by: Loymdayddaud <145969603+TheGiraffe3@users.noreply.github.com> --- wiki/CreatingMissions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/wiki/CreatingMissions.md b/wiki/CreatingMissions.md index e579891..186d027 100644 --- a/wiki/CreatingMissions.md +++ b/wiki/CreatingMissions.md @@ -734,7 +734,6 @@ on disabled ... ``` - Beginning with **v. 0.9.9**, the `enter` action supports determining the system with a [location filter](LocationFilters). This filter is formatted in the same manner as `source` or `destination` for missions, or `system` for NPCs. ```html on enter From 102b8a5e010c478a7bd988e933a2de6436dba7b3 Mon Sep 17 00:00:00 2001 From: tibetiroka <68112292+tibetiroka@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:38:53 +0200 Subject: [PATCH 5/9] Update wiki/MapData.md Co-authored-by: Loymdayddaud <145969603+TheGiraffe3@users.noreply.github.com> --- wiki/MapData.md | 1 - 1 file changed, 1 deletion(-) diff --git a/wiki/MapData.md b/wiki/MapData.md index 350d5ed..0f21a92 100644 --- a/wiki/MapData.md +++ b/wiki/MapData.md @@ -481,7 +481,6 @@ description "Frog People invaded and the planet is now almost devoid of life." has "terrible things happened" ``` - ```html spaceport ``` From 09ebef1757c5cacaa6e27f7fbcd7f2d4459000d6 Mon Sep 17 00:00:00 2001 From: mOctave <73318970+mOctave@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:21:26 -0700 Subject: [PATCH 6/9] Include default values of planetary "bribe" and tribute threshold in MapData (#25) --- wiki/MapData.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wiki/MapData.md b/wiki/MapData.md index 0f21a92..27e577b 100644 --- a/wiki/MapData.md +++ b/wiki/MapData.md @@ -545,6 +545,7 @@ security The behavior that this planet has when the player has illegal goods or outfits. The bribe number is a multiplier that modifies the severity of any fines, while the security number is a value between 0 and 1 that dictates the chance of a player's ship being scanned. +If no bribe is specified, then a default bribe of 0.01 is used. If no security is specified, then a default security of 0.25 is used. ```html @@ -573,7 +574,7 @@ The number of credits that will be paid to the player per day if this planet has threshold ``` -The combat rating that the player must have before being capable of demanding tribute from this planet. +The combat rating that the player must have before being capable of demanding tribute from this planet. If no threshold is specified, then a default threshold of 4000 is used. ```html fleet From 9fa6d59dd4ee864fb3d819c4aee939173724ba80 Mon Sep 17 00:00:00 2001 From: Vatsal Varma Date: Thu, 25 Jul 2024 19:17:40 -0400 Subject: [PATCH 7/9] Add changes for sprite animation --- wiki/SpriteData.md | 97 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/wiki/SpriteData.md b/wiki/SpriteData.md index b5f8172..d456487 100644 --- a/wiki/SpriteData.md +++ b/wiki/SpriteData.md @@ -45,10 +45,36 @@ The `` for this sprite is "effect/blaster impact". The `+` in the file nam Since **v. 0.9.15**: sprite sets can be universally resized, in case you would like to reuse an existing animation at a different size, with the `"scale"` attribute. The default scale value is `1.0` (i.e. 100%). For the best results, use a power-of-two increase or decrease, e.g. `0.125` (1/8), `0.25` (1/4), or `0.5` (1/2). Scaling factors that result in odd widths and height generally result in a blurry image, as do scales over 100%. (For most effect sprites, this will not be an issue as they are not very detailed anyway.) -## Animation parameters +## Ship Sprite Animation +Ships can have sprites for several different states of flight: Flying, Firing, Landing, Launching, Jumping, Disabled. Each state can be assigned a sprite similar to the above naming convention, but the tag will be different, as shown below: + +```html +ship + sprite + ... + sprite-firing + ... + sprite-landing + ... + sprite-launching + ... + sprite-jumping + ... + sprite-disabled + ... +``` + +Note: "sprite" and "sprite-flying" are interchangeable. + +Each sprite can be animated individually with the animation parameters as defined below. + + +### Animation Parameters You can also specify various attributes of the animation. These should be left out if you do not want them: +#### Parameters for all Sprites + * `"frame rate" `: frames per second. If no value is provided, a frame rate of 2 will be used. * `"frame time" `: alternative to "frame rate". Specifies the number of game ticks (60 per second) each frame of the animation should last for. * `"delay" `: number of animation frames to delay in between loops of the animation. For example, a four-frame animation with a delay of 4 and a frame rate of 8 FPS will play the animation for half a second, then pause for half a second, then repeat. @@ -56,6 +82,75 @@ You can also specify various attributes of the animation. These should be left o * `"random start frame"`: start at a random frame of the animation. * `"no repeat"`: once the animation has played through once, stay on the last frame until the effect disappears. If this is not defined, the animation loops. * `"rewind"`: once the animation has played through to the last frame, play it in reverse. If `"no repeat"` is also defined, the animation will play forward once, then backward once, then stop at the first frame. +* `"ramp" `: when the object enters (or exit) a certain state, this allows the frame rate to ramp up (or down) according to the values given in up fpsps (fps per second) and down fpsps. +* `"random"`: randomize the next frame played in the animation. +* `"reverse"`: play the animation from the last frame to the first. + +#### Parameters for Ship Sprites only +* `"transition delay" `: if a ship has requested a transition to a different state, i.e. FIRING to FLYING, wait for a certain number of frames before allowing that transition to occur. This would be used in places where there could be rapid state transitions. For example, if a ship has fired its primary weapon, chances are it might fire its primary weapon again, so instead of immediately transitioning to the flying state, we can wait in the firing state for a certain number of frames before entering the flying state again. +* `"transition type" `: currently, three transistion types are supported: 0 (immediate), 1 (finish), 2 (rewind). The default value is set to 0, meaning that if a ship changes state e.g. from FIRING to FLYING, the currently used sprite would immediately switch from the FIRING sprite to the FLYING sprite. If it is 1 (finish), the ship will first finish the FIRING animation, up until the last frame, before switching the state to FLYING. And if it is 2 (rewind), the ship will rewind to the first frame of the animation from whichever frame it is on currently before completing the transition to FLYING. +* `"indicate"`: applying this parameter to your sprite animation means that it must complete the animation before performing the desired action e.g. if you are trying to fire your primary weapon, the animation must reach the last frame before the weapons can actually be fired. This keyword also sets the `"repeat"` flag to false, and forces the animation to start at the zeroth frame. `"no indicate"` can also be used to disallow indication, this can be useful when dealing with trigger sprites. +* `"indicate percentage" `: applying this parameter does the same thing as the `"indicate"` keyword with one major difference, only the requested percentage of the animation needs to play before the action can be done. The animation will still complete fully. E.g. if we are trying to fire, and the FIRING animation indicate percentage is set to 50, then half of the firing animation will play before we can start to fire, and the second half will continue to play after we start firing until it reaches the last frame, where the animation will stop. +* `"trigger" `: requiring a name for the sprite like seen above, see below for more information + +##### Trigger Sprites +Trigger sprites are essentially conditional sprites which can be played within a state. They can be animated with the same parameters as above and act as their own substates. Trigger sprites have an additional attribute: conditions, as we can see below. + +```html +"trigger" + conditions + has "outfit (installed): " +``` + +There are several preliminary conditions that have been implemented, more to come as they are required: +* `"hull"`: Gives the amount of hull currently on the ship +* `"shields"`: Gives the amount of shields currently on the ship +* `"outfit (installed): "`: Checks whether the outfit is currently installed on the ship +* `"jump (type): "`: Either "jump" or "hyper", checks whether the next jump is a jump drive jump, or a hyper drive jump. +* `"weapon (firing): "`: Checks whether the currently equipped outfit/weapon is firing or not. + +Trigger sprites by default take all of the parameters defined from the default state sprite, so anything that you want different in the trigger sprite should be made explicit. For example, if you defined the frame rate for the flying state sprite to be 30, then any trigger sprites in the flying state will also have a frame rate of 30 unless defined otherwise. + +### Putting it all together +```html +ship + sprite + "frame rate" 5 + sprite-firing + ramp 20 0 + "frame rate" 20 + "indicate" + "transition delay" 100 + "transition type" 2 + sprite-landing + reverse + "frame rate" 30 + "no repeat" + sprite-launching + "frame rate" 30 + "no repeat" + "transition type" 1 + sprite-jumping + ramp 30 5 + trigger + conditions + has "jump (type): jump" + "frame rate" 20 + "indicate" + "transition type" 2 + sprite-disabled + "frame rate" 20 + "random" +``` + +Doing a run through of the above animation definition: + +1. The flying sprite will play at a frame rate of 5. +1. The firing sprite will ramp up at 20 fps per second until a frame rate of 20. The ship will not be allowed to fire until the last frame of the firing sprite is reached (indicate). Once the ship has stopped firing for 100 frames (transition delay), the animation will rewind (transition type 2) until the first frame before transitioning states again. +1. The landing sprite is the launching sprite played in reverse without repetition at a frame rate of 30 +1. The launching sprite is played at a frame rate of 30, without repetition, and will only allow a transition to the next state after reaching the last frame of the launching animation +1. The jumping sprite has a ramp up of 30 fps per second, and ramp down of 5 fps per second up until frame rate of 20. The ship can only jump until the last frame of the jumping sprite is reached (indicate) and once the ship wants to exit the jump state, the animation will rewind back to the first frame (transition type 2) before transitioning to the next state. The jump sprite also has a trigger for when the ship performs a jump drive jump. In this case, instead of the regular jumping sprite, the jumping trigger sprite is played with the same animation parameters. +1. The disabled sprite is played at a frame rate of 20, and randomly picks the next frame of the animation. ## Center From cd5b5bb54bef59d4426a76bccba6d781950e139e Mon Sep 17 00:00:00 2001 From: Vatsal Varma Date: Sat, 27 Jul 2024 03:28:36 -0400 Subject: [PATCH 8/9] Update wiki with new parameter data --- wiki/SpriteData.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/wiki/SpriteData.md b/wiki/SpriteData.md index d456487..6656575 100644 --- a/wiki/SpriteData.md +++ b/wiki/SpriteData.md @@ -88,9 +88,9 @@ You can also specify various attributes of the animation. These should be left o #### Parameters for Ship Sprites only * `"transition delay" `: if a ship has requested a transition to a different state, i.e. FIRING to FLYING, wait for a certain number of frames before allowing that transition to occur. This would be used in places where there could be rapid state transitions. For example, if a ship has fired its primary weapon, chances are it might fire its primary weapon again, so instead of immediately transitioning to the flying state, we can wait in the firing state for a certain number of frames before entering the flying state again. -* `"transition type" `: currently, three transistion types are supported: 0 (immediate), 1 (finish), 2 (rewind). The default value is set to 0, meaning that if a ship changes state e.g. from FIRING to FLYING, the currently used sprite would immediately switch from the FIRING sprite to the FLYING sprite. If it is 1 (finish), the ship will first finish the FIRING animation, up until the last frame, before switching the state to FLYING. And if it is 2 (rewind), the ship will rewind to the first frame of the animation from whichever frame it is on currently before completing the transition to FLYING. -* `"indicate"`: applying this parameter to your sprite animation means that it must complete the animation before performing the desired action e.g. if you are trying to fire your primary weapon, the animation must reach the last frame before the weapons can actually be fired. This keyword also sets the `"repeat"` flag to false, and forces the animation to start at the zeroth frame. `"no indicate"` can also be used to disallow indication, this can be useful when dealing with trigger sprites. -* `"indicate percentage" `: applying this parameter does the same thing as the `"indicate"` keyword with one major difference, only the requested percentage of the animation needs to play before the action can be done. The animation will still complete fully. E.g. if we are trying to fire, and the FIRING animation indicate percentage is set to 50, then half of the firing animation will play before we can start to fire, and the second half will continue to play after we start firing until it reaches the last frame, where the animation will stop. +* `"transition type" `: currently, three transistion types are supported: "immediate", "finish" and +"rewind". The default value is set to "immediate", meaning that if a ship changes state e.g. from FIRING to FLYING, the currently used sprite would immediately switch from the FIRING sprite to the FLYING sprite. If it is "finish", the ship will first finish the FIRING animation, up until the last frame, before switching the state to FLYING. And if it is "rewind", the ship will rewind to the first frame of the animation from whichever frame it is on currently before completing the transition to FLYING. +* `"indicate" `: applying this parameter to your sprite animation means that it must complete the animation before performing the desired action e.g. if you are trying to fire your primary weapon, the animation must reach the desired frame (optional parameter) before the weapons can actually be fired. If the frame number is not given, it will default to the last frame of the animation. This keyword also sets the `"repeat"` flag to false, and forces the animation to start at the zeroth frame. * `"trigger" `: requiring a name for the sprite like seen above, see below for more information ##### Trigger Sprites @@ -109,8 +109,7 @@ There are several preliminary conditions that have been implemented, more to com * `"jump (type): "`: Either "jump" or "hyper", checks whether the next jump is a jump drive jump, or a hyper drive jump. * `"weapon (firing): "`: Checks whether the currently equipped outfit/weapon is firing or not. -Trigger sprites by default take all of the parameters defined from the default state sprite, so anything that you want different in the trigger sprite should be made explicit. For example, if you defined the frame rate for the flying state sprite to be 30, then any trigger sprites in the flying state will also have a frame rate of 30 unless defined otherwise. - +Trigger sprites are independently animated, meaning that if you want the trigger sprite to have a frame rate of 30, and the default state sprite to also have the same frame rate, both of them would independently need to have the `"frame rate"` parameter defined. This is done in order to make saving trigger sprite animation info more streamlined. ### Putting it all together ```html ship @@ -121,7 +120,7 @@ ship "frame rate" 20 "indicate" "transition delay" 100 - "transition type" 2 + "transition type" rewind sprite-landing reverse "frame rate" 30 @@ -129,15 +128,19 @@ ship sprite-launching "frame rate" 30 "no repeat" - "transition type" 1 + "transition type" finish sprite-jumping ramp 30 5 trigger + ramp 30 5 + "frame rate" 20 + "indicate" + "transition type" rewind conditions has "jump (type): jump" "frame rate" 20 "indicate" - "transition type" 2 + "transition type" rewind sprite-disabled "frame rate" 20 "random" @@ -146,10 +149,10 @@ ship Doing a run through of the above animation definition: 1. The flying sprite will play at a frame rate of 5. -1. The firing sprite will ramp up at 20 fps per second until a frame rate of 20. The ship will not be allowed to fire until the last frame of the firing sprite is reached (indicate). Once the ship has stopped firing for 100 frames (transition delay), the animation will rewind (transition type 2) until the first frame before transitioning states again. +1. The firing sprite will ramp up at 20 fps per second until a frame rate of 20. The ship will not be allowed to fire until the last frame of the firing sprite is reached (indicate). Once the ship has stopped firing for 100 frames (transition delay), the animation will rewind until the first frame before transitioning states again. 1. The landing sprite is the launching sprite played in reverse without repetition at a frame rate of 30 1. The launching sprite is played at a frame rate of 30, without repetition, and will only allow a transition to the next state after reaching the last frame of the launching animation -1. The jumping sprite has a ramp up of 30 fps per second, and ramp down of 5 fps per second up until frame rate of 20. The ship can only jump until the last frame of the jumping sprite is reached (indicate) and once the ship wants to exit the jump state, the animation will rewind back to the first frame (transition type 2) before transitioning to the next state. The jump sprite also has a trigger for when the ship performs a jump drive jump. In this case, instead of the regular jumping sprite, the jumping trigger sprite is played with the same animation parameters. +1. The jumping sprite has a ramp up of 30 fps per second, and ramp down of 5 fps per second up until frame rate of 20. The ship can only jump until the last frame of the jumping sprite is reached (indicate) and once the ship wants to exit the jump state, the animation will rewind back to the first frame before transitioning to the next state. The jump sprite also has a trigger for when the ship performs a jump drive based jump. In this case, instead of the regular jumping sprite, the jumping trigger sprite is played with the same animation parameters. 1. The disabled sprite is played at a frame rate of 20, and randomly picks the next frame of the animation. ## Center From c7505a1668c2480eb7c6e14eab32ec9f70293749 Mon Sep 17 00:00:00 2001 From: Vatsal Varma Date: Sat, 27 Jul 2024 15:40:59 -0400 Subject: [PATCH 9/9] Clarifications for transition and indicate update --- wiki/SpriteData.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wiki/SpriteData.md b/wiki/SpriteData.md index 6656575..ccd8df2 100644 --- a/wiki/SpriteData.md +++ b/wiki/SpriteData.md @@ -88,9 +88,8 @@ You can also specify various attributes of the animation. These should be left o #### Parameters for Ship Sprites only * `"transition delay" `: if a ship has requested a transition to a different state, i.e. FIRING to FLYING, wait for a certain number of frames before allowing that transition to occur. This would be used in places where there could be rapid state transitions. For example, if a ship has fired its primary weapon, chances are it might fire its primary weapon again, so instead of immediately transitioning to the flying state, we can wait in the firing state for a certain number of frames before entering the flying state again. -* `"transition type" `: currently, three transistion types are supported: "immediate", "finish" and -"rewind". The default value is set to "immediate", meaning that if a ship changes state e.g. from FIRING to FLYING, the currently used sprite would immediately switch from the FIRING sprite to the FLYING sprite. If it is "finish", the ship will first finish the FIRING animation, up until the last frame, before switching the state to FLYING. And if it is "rewind", the ship will rewind to the first frame of the animation from whichever frame it is on currently before completing the transition to FLYING. -* `"indicate" `: applying this parameter to your sprite animation means that it must complete the animation before performing the desired action e.g. if you are trying to fire your primary weapon, the animation must reach the desired frame (optional parameter) before the weapons can actually be fired. If the frame number is not given, it will default to the last frame of the animation. This keyword also sets the `"repeat"` flag to false, and forces the animation to start at the zeroth frame. +* `"transition type" `: currently, three transistion types are supported: "immediate", "finish" and "rewind". The default value is set to "immediate", meaning that if a ship changes state e.g. from FIRING to FLYING, the currently used sprite would immediately switch from the FIRING sprite to the FLYING sprite. If it is "finish", the ship will first finish the FIRING animation, up until the last frame, before switching the state to FLYING. And if it is "rewind", the ship will rewind to the first frame of the animation from whichever frame it is on currently before completing the transition to FLYING. +* `"indicate" []`: applying this parameter to your sprite animation means that it must complete the animation before performing the desired action e.g. if you are trying to fire your primary weapon, the animation must reach the desired frame (optional parameter) before the weapons can actually be fired. If the frame number is not given, it will default to the last frame of the animation. This keyword also sets the `"repeat"` flag to false, and forces the animation to start at the zeroth frame. * `"trigger" `: requiring a name for the sprite like seen above, see below for more information ##### Trigger Sprites