Universal Installation System
Intent
-
This is meant for a hotfix -
This is meant for the next release (see milestone) -
This needs more reviewers than normal, there may be controversy -
This intentionally introduces regressions that will be addressed later -
There is/will be documentation changes on the wiki
Features
-
Install Upgrades into Items -
Install Programs into Cyberdecks -
Install Cyberware into Actors -
Install Upgrades/Programs into unowned items -
Transfer Items
containingItems
from one Actor to Another Actor -
Transfer Items
containingItems
from the World to an Actor -
Transfer Items
containingItems
from an Actor to the World -
Transfer loaded weapons from one Actor to Another Actor -
Handle deletion of installed items where applicable -
Ability to create a-> Deferring to a future MRCompendium
of Upgraded Items
Description
In CPR-Core, we were handling all of the following differently:
- Installing Upgrades into Items
- Installing Programs into Cyberdecks
- Installing Cyberware into Actors
The problem with this is that it would require custom code for installations such as a Cyberdeck
into a Bodyweight Suit
or Cyber Arm
. Additionally, it would need custom code for inserting a Skill Chip
into a Chipware Socket
. The purpose of this merge request is to consolidate the code path for installing items into objects (items/actors) and allow for scenarios as the ones mentioned here.
When the mixins
were added, the slots
data point moved to the upgradable
mixin, however, the code for the Cyberdeck
was still using this data point to track the number of Programs
that were allowed to be installed. Fortunately, Cyberdecks
were upgradable
so it actually didn't cause any noticeable code issues, but it did combine the capacity of upgrade slots
and the program slots
into a single value. Cyberware
, however had it's own slot count and tracking code.
With this merge, slots
is removed from upgradable
and Cyberware
loses the following data points:
"hasOptionalSlots": false,
"optionSlots": 0,
"installedOptionSlots": 0,
"optionalIds": [],
The base common
template was modified for Actors
and Items
with the following:
Actor - template common
"installedItems": {
"allowedTypes": ["cyberware"],
"allowed": true,
"list": []
}
Item - template container
"installedItems": {
"allowedTypes": ["itemUpgrade"],
"allowed": true,
"list": [],
"usedSlots": 0,
"slots": 3
}
The primary difference here being that Actors
don't have slots
and usedSlots
as they don't have a limited capacity for items to be installed into them.
allowed
- Boolean whether or not items can be installed into this item.
allowedTypes
- List of item.type that are allowed to be installed into this item.
list
- List of UUID's of the items that are installed into this item.
Upgrade data remains in the upgradable
template and is used for applying upgrades to data points.
Program data remains in the programs
data point on a cyberdeck
item.type and is used for execution/utilization on the Cyberdeck.
The only real change here is that the installedItems.list
is considered the "source of truth" as to what upgrades or programs should be installed in the item. As such, the upgradable
mixin received a new function called syncUpgrades()
which will synchronize upgrade data with installedItems. Likewise, cyberdeck
item.type received a new function called syncPrograms()
which will synchronize the program data with the installedItems.
This change also includes code so that installed items now "transfer" with the item they are installed in. So a Cyberdeck containing programs that is dragged from one actor to another will move the Cyberdeck and all installed programs from one actor to the other actor. This functionality/concept of transferring "dependent items" has been extended to also include ammo loaded into a weapon that is transferred from one actor to another. This did require a change from just storing the ammoId
. The loadable
mixin has been modified to store the ammo UUID and name instead of just the ID. The loadable
mixin changes from:
"loadable": {
"usesType": "magazine",
"magazine": {
"value": 0,
"max": 0,
"ammoId": ""
},
"ammoVariety": []
},
to
"loadable": {
"usesType": "magazine",
"magazine": {
"value": 0,
"max": 0,
"ammoData": {
"name": "",
"uuid": ""
}
},
"ammoVariety": []
},
Furthermore, an upgraded item that exists on an actor can be dragged to the right side Item Pane to create an upgraded world item. Any installed items are created in a folder called CPR-Core Installed Items
(in English, the actual name is controlled by the localized variable CPR.settings.installedItemsFolder
). Any attempt to delete a World Item that is referenced as being installed in another World Item will fail displaying a dialog that provides information as to where the item is installed in, including the Folder that World Item may be located in.
Any loaded weapons dragged to the right side Item Pane will have their ammo removed/deleted from the item. There's no real need to have a million ammo item references in the world for these items.
Unloading a weapon which an actor does not have the ammo for will do a "best attempt" to identify/re-create an Ammo item in the Actors inventory. Best attempt includes:
- See if there is a matching owned ammo item of the same
name
as the loaded ammo, if so, use that - See if there is a matching world ammo item of the same
name
as the loaded ammo and re-create it on the actor
Lastly, there have been some style changes/indicators added to the Gear and Cyber tabs to indicate items are installed and/or have installed items.
Some sample screen shots:
Here we show a Cyberdeck install in an arm as well as some Kung Fu Chipware installed in a Chipware socket:
Icon indicating item is installed in another item, hovering shows which item, clicking will open the sheet of the item it is installed in:
Viewing an item that has other items installed:
Related Issues
- #348 (closed)
- #463 (closed)
- #510
- Token Resource Issue: All installed items (Cyberware) were showing up as data points on the actor.
Steps to Test
Testing Installed Items
- Create actor (myActor) and add the following Compendium items:
- Cyberware
- Cyberarm
- Cyberdeck (Hardwired)
- Big Knucks
- Kerenzikov
- Interface Plugs
- Neural Link
- Chipware Socket
- Gear
- Cyberdeck
- Programs
- See Ya
- Speedy Gonzalez
- Weapon
- Assault Rifle
- Ammo
- Basic Rife (adjust
amount
to 100)
- Basic Rife (adjust
- Open
Cyberdeck (Hardwired)
- Settings Tab: Click
Installed Items
at the bottom - Select
Cyberdeck
- Click
Confirm
- Note the following changes:
-
Cyberdeck
now has ai
icon next to the name. Hovering shows where it is installed. Clickingi
opens the item it was installed in. - View item sheet for
Cyberdeck (Hardwired)
and note under the name it states it has installed items
-
Delete
Cyberdeck (Hardwired)
, note thei
is now gone from theCyberdeck
indicating it is no longer installed. -
Re-add
Cyberdeck (Hardwired)
from the Compendium. -
Repeat Step 2 to re-install
Cyberdeck
. OpenCyberdeck (Hardwired)
and confirm it shows it hasInstalled Items
. -
Click arrow next to
Cyberdeck
, install any/allPrograms
. -
Delete
Cyberdeck
, notePrograms
returned to inventory. OpenCyberdeck (Hardwired)
, note theCyberdeck
is no longer installed. -
Re-add
Cyberdeck (Hardwired)
from the Compendium. -
Repeat Step 2 to re-install
Cyberdeck
. -
Click arrow next to
Cyberdeck
, install allPrograms
. -
Install
Cyberarm
&Cyberdeck (Hardwired)
. -
View
Cyber
tab and note indentation indicating installation location. -
Import "Skill Chip" Cyberware Item to World
-
Edit imported Skill Chip:
- Settings Tab: Change name to "Skill Chip (Kung Fu)"
- Effects Tab: Create Effect
- Change
When to Enable
toWhen Installed
- Edit
New Effect
- Details: Effect Label: Kung Fu
- Effects: Click Plus to add an effect
- Change
Perception
toMartial Arts
- Set
Effect Value
to 3 - Click
Submit Changes
- Change
-
Create Item: Name: Asp Type: Program
-
Configure Program Asp
- Set class to Black ICE
- Program Size: 2
- Per: 2
- Spd: 3
- Atk: 4
- Def: 5
- Rez: 15
-
Drag
Program Asp
andSkill Chip (Kung Fu)
to Actor -
Create a Scene (myScene)
- Under Lighting, disable Token Vision to make things easier to see
-
Drag Actor (myActor) to Scene
-
Open Token Actor
-
Click arrow next to
Cyberdeck
, installAsp
. -
Install Cyberware:
-
Neural Link
- Foundational, roll dice if you want -
Chipware Socket
- Select target install drop down and chooseNeural Link
- NoticeNeural Link
is the ONLY option here -
Kerenzikov
- Select target install drop down and notice there's now two options,Neural Link
andChipware Socket
. SelectNeural Link
as that is the only thing that makes sense. -
Skill Chip (Kung Fu)
- Select target install drop down and notice there's now two options,Neural Link
andChipware Socket
. SelectChipware Socket
as that is where Chipware is installed into. -
Interface Plugs
- Select target install drop down and chooseNeural Link
- NoticeNeural Link
is the ONLY option here now, because the Chipware Socket only has space for 1 item and that is now occupied bySkill Chip (Kung Fu)
-
View
Cyber
tab and note indentation indicating installation location. -
Confirm
Martial Arts
Bonus Effect. -
Equip
Cyberdeck
, switch toFight: Net
tab -
Rez various
Programs
and confirm they are working as expected. -
De-rez Black Ice and confirm token goes away.
-
Test various
Cyberware
Uninstallation Scenarios:
- Uninstall
Skill Chip (Kung Fu)
/ Re-install - Uninstall populated
Chipware Socket
, ensure all items return to inventory / Re-install - Uninstall
Neural Link
, ensure all items return to inventory / Re-install
Test Installed Item Transfer
- Create second actor (myActor2)
- Drag
cyberdeck
from myActor to myActor2 and ensure all of the installed programs go with it - Drag
cyberdeck
from myActor2 to the right side Items Pane creating a world item. - A new folder will be created to store the installed programs.
- Open new
cyberdeck
world item sheet, inspect settings to ensure programs are listed. - Drag the
cyberdeck
world item to myActor and ensure all of the programs copy over as well. - Ensure install/uninstall/rez/de-rez functionality on myActor
- Try to delete a program listed in the "CPR-Core Installed Items", should fail referencing install in
cyberdeck
Test Weapon Ammo Transfers
- Load
Assault Rifle
on myActor withBasic Rifle
ammo - Drag
Assault Rifle
from myActor to myActor2 - Note new
Basic Rifle
Ammo Item exists in myActor2 - Test unload/load/reload functions of
Assault Rifle
on myActor2. - Load
Assault Rifle
on myActor2 - Delete
Basic Rifle
ammo on myActor2. There should also be noBasic Rifle
ammo world items that exist. - Attempt to unload
Assault Rifle
. Warning is displayed that it is unable to determine the ammo object, the weapon is unloaded and the ammo is lost. - Add
Basic Rifle
ammo to myActor2 - Load
Assault Rifle
. - Drag
Basic Rifle
ammo to the right side Item Pane to create a World Item calledBasic Rifle
. - Delete
Basic Rifle
ammo on myActor2 - Unload
Assault Rifle
- Note new
Basic Rifle
ammo is created as it is found as a world item and the item is unloaded as expected.
Migration
- Load an existing world
- Repeat all tests above in existing world after migration, using items that pre-existed as well as new items on the world actors.
Future Work
- Ability to create a
Compendium
of Upgraded Items - The only way to install an item into another item is to do it from the "containerized item". We need to implement code to install the item into the "containerized item" from the "installable" item.
Additional Notes
- Uninstalling a
Cyberarm
that has aCyberdeck (Hardwired)
&Cyberdeck
installed, will uninstall everything, including thePrograms
. This is because uninstalled ofCyberware
is always recursive. We could make it recursive until it hits a non-cyberware item, which would prevent this, but I haven't fully processed the implications of that.