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

feat: add v0.2.0.6 map objects #168

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion palworld_save_tools/rawdata/map_concrete_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
"stool01_stone": "PalBuildObject",
"stove01_stone": "PalBuildObject",
"tablecircular01_stone": "PalBuildObject",
"tabledresser01_stone": "PalBuildObject",
"tabledresser01_stone": "PalMapObjectCharacterMakeModel",
"tablesink01_stone": "PalBuildObject",
"toilet01_stone": "PalBuildObject",
"toiletholder01_stone": "PalBuildObject",
Expand All @@ -312,6 +312,15 @@
"trafficsign03_iron": "PalBuildObject",
"trafficsign04_iron": "PalBuildObject",
"chair01_pal": "PalBuildObject",
"altar": "PalBuildObjectRaidBossSummon",
"copperpit": "PalMapObjectProductItemModel",
"copperpit_2": "PalMapObjectProductItemModel",
"electrichatchingpalegg": "PalMapObjectHatchingEggModel",
"pickupitem_cavemushroom": "PalMapObjectPickupItemOnLevelModel",
"treasurebox_oilrig": "PalMapObjectTreasureBoxModel",
"treasurebox_electric": "PalMapObjectTreasureBoxModel",
"treasurebox_ivy": "PalMapObjectTreasureBoxModel",
"treasurebox_ice": "PalMapObjectTreasureBoxModel",
}
NO_OP_TYPES = set(
[
Expand Down Expand Up @@ -374,6 +383,8 @@ def pickup_base():
data["remain_product_num"] = reader.i32()
data["requested_product_num"] = reader.i32()
data["work_speed_additional_rate"] = reader.float()
if not reader.eof():
data["can_transport_out_product"] = reader.u32() > 0
elif map_object_concrete_model == "PalMapObjectPickupItemOnLevelModel":
pickup_base()
elif map_object_concrete_model == "PalMapObjectDropItemModel":
Expand All @@ -389,6 +400,8 @@ def pickup_base():
data["drop_item_infos"] = reader.tarray(pal_item_and_num_read)
elif map_object_concrete_model == "PalMapObjectDeathPenaltyStorageModel":
data["owner_player_uid"] = reader.guid()
if not reader.eof():
data["created_at"] = reader.u64()
elif map_object_concrete_model == "PalMapObjectDefenseBulletLauncherModel":
data["remaining_bullets"] = reader.i32()
data["magazine_size"] = reader.i32()
Expand Down Expand Up @@ -466,6 +479,8 @@ def encode_bytes(p: Optional[dict[str, Any]]) -> bytes:
writer.i32(p["remain_product_num"])
writer.i32(p["requested_product_num"])
writer.float(p["work_speed_additional_rate"])
if "can_transport_out_product" in p:
writer.u32(1 if p["can_transport_out_product"] else 0)
elif map_object_concrete_model == "PalMapObjectPickupItemOnLevelModel":
writer.u32(1 if p["auto_picked_up"] else 0)
elif map_object_concrete_model == "PalMapObjectDropItemModel":
Expand All @@ -477,6 +492,8 @@ def encode_bytes(p: Optional[dict[str, Any]]) -> bytes:
writer.tarray(pal_item_and_slot_writer, p["drop_item_infos"])
elif map_object_concrete_model == "PalMapObjectDeathPenaltyStorageModel":
writer.guid(p["owner_player_uid"])
if "created_at" in p:
writer.u64(p["created_at"])
elif map_object_concrete_model == "PalMapObjectDefenseBulletLauncherModel":
writer.i32(p["remaining_bullets"])
writer.i32(p["magazine_size"])
Expand Down