Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Situation Based Ship Animations Wiki Update #31

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
11 changes: 9 additions & 2 deletions wiki/CreatingMissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,13 @@ 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
Expand All @@ -754,7 +761,7 @@ dialog phrase <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.

Expand Down Expand Up @@ -785,7 +792,7 @@ 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 <model> [<name>]
Expand Down
15 changes: 12 additions & 3 deletions wiki/MapData.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,21 @@ The [music](#ambient-music) that is played while landed on this planet.
description <text>
```

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 <text>
```

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 [<name>]
Expand Down Expand Up @@ -537,6 +545,7 @@ security <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
Expand Down Expand Up @@ -565,7 +574,7 @@ The number of credits that will be paid to the player per day if this planet has
threshold <rating#>
```

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 <name> <count#>
Expand Down
100 changes: 99 additions & 1 deletion wiki/SpriteData.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,115 @@ The `<name>` 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Ships can have sprites for several different states of flight: Flying, Firing, Landing, Launching, Jumping, and 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 <name>
sprite <path-to-flying-sprites>
...
sprite-firing <path-to-firing-sprites>
...
sprite-landing <path-to-landing-sprites>
...
sprite-launching <path-to-launching-sprites>
...
sprite-jumping <path-to-jumping-sprites>
...
sprite-disabled <path-to-disabled-sprites>
...
```

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" <fps#>`: frames per second. If no value is provided, a frame rate of 2 will be used.
* `"frame time" <number#>`: alternative to "frame rate". Specifies the number of game ticks (60 per second) each frame of the animation should last for.
* `"delay" <number#>`: 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.
* `"start frame" <number#>`: start at this frame of the animation.
* `"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" <up fpsps#> <down fpsps#> `: 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `"ramp" <up fpsps#> <down fpsps#> `: 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.
* `"ramp" <up fpsps#> <down fpsps#>`: 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" <number#>`: 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" <number#>`: currently, three transistion types are supported: "immediate", "finish" and
XessWaffle marked this conversation as resolved.
Show resolved Hide resolved
"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" <number# (optional)>`: 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.
XessWaffle marked this conversation as resolved.
Show resolved Hide resolved
* `"trigger" <name>`: 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" <name>
conditions
has "outfit (installed): <outfit-name>"
```

There are several preliminary conditions that have been implemented, more to come as they are required:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are several preliminary conditions that have been implemented, more to come as they are required:
There are several preliminary conditions that have been implemented, with more to come as they are requested:

* `"hull"`: Gives the amount of hull currently on the ship
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `"hull"`: Gives the amount of hull currently on the ship
* `"hull"`: Gives the amount of hull currently on the ship.

Others as well?

* `"shields"`: Gives the amount of shields currently on the ship
* `"outfit (installed): <outfit-name>"`: Checks whether the outfit is currently installed on the ship
* `"jump (type): <jump-type>"`: Either "jump" or "hyper", checks whether the next jump is a jump drive jump, or a hyper drive jump.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the player doesn't have it mapped yet?

* `"weapon (firing): <outfit-name>"`: Checks whether the currently equipped outfit/weapon is firing or not.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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 <name>
sprite <path-to-flying-sprite>
"frame rate" 5
sprite-firing <path-to-firing-sprite>
ramp 20 0
"frame rate" 20
"indicate"
"transition delay" 100
"transition type" rewind
sprite-landing <path-to-launching-sprite>
reverse
"frame rate" 30
"no repeat"
sprite-launching <path-to-launching-sprite>
"frame rate" 30
"no repeat"
"transition type" finish
sprite-jumping <path-to-jumping-sprite>
ramp 30 5
trigger <path-to-jumping-trigger-sprite>
ramp 30 5
"frame rate" 20
"indicate"
"transition type" rewind
conditions
has "jump (type): jump"
"frame rate" 20
"indicate"
"transition type" rewind
sprite-disabled <path-to-disabled-sprite>
"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 until the first frame before transitioning states again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to successive numbering?

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 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

Expand Down