## Summary Adds comprehensive RunUO → ModernUO migration documentation and Claude AI skills to help shard owners and script authors convert RunUO 2.7 code to ModernUO. - **10 migration skills** (`dev-docs/claude-skills/migrate-from-runuo/`) — system-by-system conversion guides (foundation, serialization, timers, gumps, packets, property lists, commands/events, persistence, items/mobiles, systems/engines) - **12 reference docs** (`dev-docs/runuo-migration-docs/`) — deep-reference with before/after examples, API mapping tables, edge cases, and gotchas - **Updated existing skills** — `modernuo-timers`, `modernuo-serialization`, and `modernuo-threading` now document that `Serialize()` runs on background threads and timers are not thread-safe - **Updated `CLAUDE.md`** — added migration skill lookup table ### Key migration patterns covered - Manual `Serialize()`/`Deserialize()` → source-generated `[SerializableField]` - `Packet` class hierarchy → static `SpanWriter`/`SpanReader` methods - `Timer` subclasses → `TimerExecutionToken` fire-and-forget - `Gump` → `StaticGump<T>`/`DynamicGump` with builders - `EventSink.WorldSave` → `GenericPersistence` - `ObjectPropertyList` → `IPropertyList` with string hole rules - Universal changes: naming (`m_` → `_`), `[Constructable]` → `[Constructible]`, logging, spatial queries
2.3 KiB
2.3 KiB
| name | description |
|---|---|
| migrate-items-mobiles | Trigger: when converting RunUO Item, Mobile, or BaseCreature subclasses to ModernUO. Most common migration task. Covers: complete item/creature conversion combining serialization, timers, properties, naming. |
RunUO -> ModernUO Item/Mobile/Creature Migration
When This Activates
- Converting any
Itemsubclass from RunUO - Converting any
Mobile/BaseCreaturesubclass - This is the most common migration task -- combines all other systems
Item Conversion Checklist
- Foundation: file-scoped namespace,
using ModernUO.Serialization; - Class: add
[SerializationGenerator(0, false)], addpartial - Fields:
m_X->[SerializableField(N)] _xwith[SerializedCommandProperty] - Add
[InvalidateProperties]where RunUO setter calledInvalidateProperties() - Delete: Serial constructor, Serialize, Deserialize
[Constructable]->[Constructible]Name = "text"->public override string DefaultName => "text";- Timers: nested class ->
Timer.StartTimer()+TimerExecutionToken+[AfterDeserialization]+OnAfterDelete - Properties:
GetProperties(ObjectPropertyList)->GetProperties(IPropertyList), apply string hole rule - Context menus:
List<ContextMenuEntry>->ref PooledRefList<ContextMenuEntry>
Creature-Specific Changes
[CorpseName("...")]attribute ->public override string CorpseName => "...";BaseCreature(AI, Fight, 10, 1, 0.2, 0.4)->BaseCreature(AI, Fight)(extra params default)Name = "text"->public override string DefaultName => "text";- Expression-bodied overrides:
public override int Meat { get { return 1; } }->public override int Meat => 1;
Anti-Patterns
- Using
_field--instead ofProperty--(bypasses MarkDirty tracking) - Forgetting
[AfterDeserialization]for timer restoration - Forgetting
OnAfterDelete()for timer cancellation
See Also
dev-docs/runuo-migration-docs/09-items-mobiles-creatures.md-- detailed migration with before/after examplesdev-docs/content-patterns.md-- ModernUO content templatesdev-docs/claude-skills/modernuo-content-patterns.md-- ModernUO content skilldev-docs/claude-skills/modernuo-serialization.md-- serialization patternsdev-docs/claude-skills/modernuo-timers.md-- timer patterns