Discuss Scratch

solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

·¤ Phantom Shadows Documentation ¤·

Please don't create posts here! If you want to ask something, post your comment here!

This discussion is meant to be a knowledge base for everyone who is interested in remixing Phantom Shadows. As this project is over one year in development, it got incredible huge and it's hard to understand our scripts. That's why we're creating a documentation with everything you need to know about our project Phantom Shadows.

I am going to give my very best to keep this updated and publish a documentation to every sprite as soon as possible.

Navigation:

Jump to sprite documentations:

General Stuff
Stage
Thumbnail
Player
MapDrawer
darkTerrain
Buildings
choose class
info
enemies
platform
skill_icons
writing_engine
level
level2
game guide
guide:monster
skip_intro
intro
Text
death
range_attack

Jump to important data:

Work in progress

Other things:

How you reach a level-up…

______________________________________________________________________________
¤ = might be interesting for a potential remix
¤ = this information is very important
¤ = normal information

Last edited by solved (June 2, 2017 19:22:25)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

General stuff:

Most sprites react to the “Frame_change” broadcast to hide/show themselves, update costumes or maybe start scripts or loops. To avoid duplications, I won't mention it for every sprite.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:07:31)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Stage:

The stage is responsible for all actions concerning in-game music and for the background which shall show after setting a new frame or starting a dialogue.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:07:43)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “Thumbnail”:

The thumbnail sprite is used to set a thumbnail before saving the project.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:07:54)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “Player”:
This sprite shows the animation of the player, accepts the moving inputs (e.g. “left arrow pressed”) and changes the ScrollX variable to update the world around him.
The player also manages the first part of attacks and special behaviors of the classes.

It makes use of the original sprite as an invisible hitbox and a clone who shows the animations.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:08:06)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “MapDrawer”:

The MapDrawer is currently used to show all objects of the map without interaction possibilities. (A future update will change that.)
It is the place where the _objectData list is in use. This list determines an object by saving a name, corresponding costumes, a colour effect and an interaction type.

The MapDrawer works by updating position and costume of 48 clones every “sceenTick”. The “screenTick” broadcast gets send by this sprite right after the last “screenTick” was completed.
The world loading process is done within this sprite and uses solvedScript v2.1.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:08:17)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “darkTerrain”:

Used to manage where the dark terrain starts. You may broadcast “_darkterrain.moveBack” to move the dark terrain to the next spot in the list _darkTerrainSpots.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:08:29)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “Buildings”:

This sprite is subject to be removed after adding what it does to the MapDrawer in a future update.
It needs one clone per new building and runs two forever loops (One as a “screenTick” broadcast, one actual forever loop).
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:08:50)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “choose class”:

Used to choose one of the three classes ( Elf | Knight | Mage ) after playing the intro and the text intro. The sprite has two clones which both get deleted after a class was chosen.

The original sprite shows as an image in the game guide, too.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:09:03)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “info”:

The actual logics behind interacting with buildings. It sends different broadcasts and performs different actions depending on the options for the building. These options are currently hard-coded.
The sprite also shows the options for the buildings by switching to a corresponding costume.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:09:18)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “enemies”:

Each enemy needs a new clone and each clone runs one forever loop. Each clone is responsible for taking & dealing damage, moving and planning what to do. The most important variable is the “CloneAI”-var which saves the current AI state of the enemy.
An enemy saves all relevant information for him in corresponding variables.

After creating the world, a few enemies are going to spawn.
This sprite also has an enemy respawn behavior which is called after entering beginner's town.

Since v0.25.0, all monsters are completely data-driven. This means adding new monsters is even easier now.
Here's how it works:
_mAllMonsterStats is a global list that contains 4 items per monster. The first is the monster name, the second is the monster description, the third is the current number of that monster in the game, and the fourth is a solvedScript list that contains all the unique monster data:

Level – used to calculate experience reward upon death (Level * 25)
HP – hitpoints; amount of damage monster can take before dying
AttackRange – distance at which monster will strike (abs of CloneX – ScrollX)
AttackDamageMin – minimum amount of damage dealt if monster attack hits
AttackDamageMax – maximum amount of damage dealt if monster attack hits
AttackCooldown – the amount of time (in seconds/30) the monster waits between attacks.
BlockMin – minimum amount of damage blocked if the monster is successful in blocking player attack
BlockMax – maximum amount of damage blocked if the monster is successful in blocking player attack
BlockChance – chance of blocking player attack (%)
WeakSpotYMin – lower bound of y position of monster's weak spot (used to award elf SP)
WeakSpotYMax – upper bound of y position of monster's weak spot (used to award elf SP)
AbilityType – name of ability; must be same as in costume names (e.g. “jump” for dwarf_jump1)
AbilityRangeMax – maximum distance at which monster will execute ability (abs of CloneX – ScrollX)
AbilityRangeMin – minimum distance at which monster will execute ability (abs of CloneX – ScrollX)
AbilityCooldown – the amount of time (in seconds/30) the monster waits between using abilities.
MovementType – “Ground” or “Flying”; used to apply gravity
WalkCostumes – number of costumes in walking animation
AttackCostumes – number of costumes in attacking animation
AbilityCostumes – number of costumes in ability animation
DamageCostumeStart – first costume of attacking animation that can deal damage
DamageCostumeEnd – last costume of attacking animation that can deal damage
CoinMin – minimum number of coins dropped on death
CoinMax – maximum number of coins dropped on death
CoinChance – chance of dropping more than minimum amount of coins (% chance for each extra)
CommonLootItems – solvedScript list of items that are commonly dropped (e.g. {health_potion}{speed_potion} )
CommonLootMin – minimum number of common items dropped
CommonLootMax – maximum number of common items dropped
CommonLootChance – chance of dropping more than minimum amount of common items (% chance for each extra)
RareLootItems – solvedScript list of items that are rarely dropped (e.g. {greater_health_potion}{charm_of_returning} )
RareLootMin – minimum number of rare items dropped
RareLootMax – maximum number of rare items dropped
RareLootChance – chance of dropping more than minimum amount of rare items (% chance for each extra)


_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 24, 2017 20:22:26)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “platform”:

Doesn't show up in-game, used to detect the floor and has no scripts running.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:09:37)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “skill_icons”:

Every class has it's own costume. It's updated at the start of each game.
This sprite only reacts during the game to the “open_skillmenu”-broadcast.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:10:08)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “writing_engine”:

Used wherever we weren't able to use a pen text engine (everything skillpoint related, shadowcoin number & experience).
A clone is needed for every digit of a number. You can update it's costume by sending the “number_refresh” broadcast.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:09:56)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “level”:

Responsible for updating the level number. Only reacts to the “levelUp” broadcast.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:10:22)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “level2”:

The GUI behind the “level”-sprite. It opens the “skill menu” and plays an animation after reaching a level up.
This sprite also is calculating the level after the experience changed (“XP”-braodcast).


Calculation:
Experience per level is given by the equation:
10x^3 + 90x

For example:
At level 1 you need 10+90 = 100 experience to level up (kill 2 trolls)
At level 2 you need 10*8+90*2 = 260 total experience to level up (160 more than level 1, kill 2 trolls and 1 dwarf)
At level 3 you need 10*21 + 90*3 = 540 total experience to level up (280 more than level 1, kill 3 trolls and 3 dwarves)

_________________________________________________________

lvl xp
1 100
2 260
3 540
4 1000
5 1700
6 2700
7 4060
8 5840
9 8100
10 10900
11 14300
12 18360
13 23140
14 28700
15 max


_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:13:26)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “game guide”:

Opens the game guide (-frame) and implements switching its tabs.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:10:50)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “guide:monster”:

The guide:monster sprite shows the information for discovered monsters. In addition, it's showing the pop-up if a new monster was discovered. You can directly open the game guide with the monster tab selected by clicking on it.

Uses two clones to switch the monster entry page.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:11:00)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “skip_intro”:

Allows skipping the intro after showing the credits. Doesn't run any script after the intro.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:11:35)


solved
Scratcher
100+ posts

· • ¤ Phantom Shadows Documentation ¤ • ·

Sprite - “intro”:

Shows the intro & credits. It doesn't run scripts after playing the intro and starting the text intro by sending the “text_intro” broadcast.
_____________________________________________________________
¤ return to navigation ¤

Last edited by solved (June 2, 2017 19:11:44)


Powered by DjangoBB