Code Monkey home page Code Monkey logo

dfu-locationloader's People

Contributors

cliffworms avatar drcarademono avatar kaboissonneault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dfu-locationloader's Issues

Variant Loader

New system to make LL handle block/location variants through a more global "rules" system, rather than letting users do specific variant assignments themselves.

DFU's WorldDataVariant

  • WDV is what we're dealing with. What items (ie: files) and what operations WDV allows limits what we can do without sending PRs to Gavin

Items:

  • Location variant (ex: Daggerfall_wod)
  • New Location
  • Block variant (ex: ALCHALAA00_wod)
  • Building variant (ex: ALCHALAA00.0_wod)

Operations:

  • SetLocationVariant(location, variant) -> change Daggerfall to Daggerfall_wod
  • SetNewLocationVariant(region, locationName, variant)
  • SetBlockVariant(blockName, variant) -> change all ALCHALAA00 to ALCHALAA00_wod
  • SetBlockVariant(blockName, variant, locationKey) -> change all ALCHALAA00 to ALCHALAA00_wod in Daggerfall
  • SetBuildingVariant(blockName, recordIndex, variant) -> set building 0 in all ALCHALAA00 to _wod variant
  • SetBuildingVariant(blockName, recordIndex, variant, locationKey) -> set building 0 in ALCHALAA00 in Daggerfall to _wod variant

Notes:

  • Building variants apply to all variants of a given block! ALCHALAA00_wod must still work with ALCHALAA00.0_wod

VariantLoader

Tools:
RMBVariantScriptGenerator

  • Generates variant scripts from rule specifications.
  • Also generates location variants if needed (see local rules)
  • Block variants are all provided by the user before running this tool
    RMBVariantRules -> RMBVariantScripts + location variants

VariantLoader

  • Runtime system in LocationLoader.dfmod
  • Reads RMBVariantScripts from all mods and applies instructions
  • WorldDataVariant.SetBlockVariant(...) / WorldDataVariant.SetLocationVariant(...)
  • Scripts are applied by mod order (if a mod has multiple scripts, their order is random)
    Question: Global scripts, script per region, script per map pixel?
    Scenario:
    Scenario 1
    • World of Daggerfall has script Daggerfall.rmbs.txt which sets ALCHALAA00 to variant _wod in location key 12317
    • Alchemy Expanded depends on World of Daggerfall, and therefore has "higher priority" (lower on the list)
    • Alchemy Expanded has HighRock.rmbs.txt, which sets ALCHALAA00 to _ae in location key 12317
    • When location 12317 is loaded, Alchemy Expanded wins, and the WoD instruction is ignored (clashing location and block target)
      Scenario 2
    • World of Daggerfall has script Daggerfall.rmbs.txt which sets ALCHALAA00 to variant _wod in location key 12317
    • Alchemy Renovated has a building replacement as ALCHALAA00.RMB-60-building0_ar.json
    • Building variant still applies to ALCHALAA00_wod

Items:
RMBVariantRules

  • CSV file with .rmb.csv extension
  • Each line forces a "target" block to a specified variant, if conditions are met
  • Rules are not built into the mod - they're used only for the generator
    Rules
  • We can divide conditions in three type
    Global
  • Rule applies to all the blocks with the target in the location
  • The effect can be applied with WorldDataVariant.SetBlockVariant(blockName, variant, locationKey)
  • A block variant is sufficient
    Local
  • Rule applies only to certain blocks with the target in the location,
    ex: North Edge, No Edge, ...
  • The effect cannot be applied with WorldDataVariant.SetBlockVariant(blockName, variant, locationKey)
  • Therefore, we need a location variant
    Runtime
  • Rule applies depending on runtime conditions,
    ex: quest active
  • Depending on other conditions, might be global or local. Global rules still work as block variants, and local rules as location variants
  • This requires extra runtime to apply and remove the variant as needed

Format
OLD_BLOCK VARIANT RULE1 ... RULEN
ex: ALCHALAA00 _dhw Daggerfall HauntedWoods

  • ALCHALAA00 is the target block. When the region is Daggerfall and the climate is haunted woods, the _dhw variant (ex: ALCHALAA00_dhw) should be set

RMBVariantScript

  • Text file with .rmbs.txt extension. Each line has a specific format
  • Set of instructions for knowing what variants to apply where
  • Instruction may have runtime constraints (ex: quest id)
  • Scripts are part of a built mod
    Issues:
  • For any runtime rule we invent, extra data needs to be hardcoded here. VariantLoader will not try to find what rules it was generated from.
  • We might not invent that many
    Format
    <locationkey> <blockname> <blockvariant> [quest <quest_id>]
    or <locationkey> variant <locvariant> [quest <quest_id>]

FindObjectsOfType crash

0x00007FF9636C9340 (UnityPlayer) UnityMain
0x00007FF9639FA64C (UnityPlayer) UnityMain
0x00007FF963A8F594 (UnityPlayer) UnityMain
0x00000218449BEE7A (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Object:FindObjectsOfType (System.Type)
0x00000218AA43E3A3 (Mono JIT Code) UnityEngine.Object:FindObjectsOfType<T_REF> ()
0x00000218AA4B1D6B (Mono JIT Code) LocationLoader.LocationLoader/<InstantiateAllDynamicObjectsNextFrame>d__15:MoveNext ()
0x0000021868C4BDAC (Mono JIT Code) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
0x0000021868C4BED7 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_object_intptr (object,intptr,intptr,intptr)

Player(35).log

See @drcarademono, LL has this issue too

Request : Add mod dependencies for custom objects

With Ninelan's Expanded Textures upcoming release, which will be a .dfmod, it'd be very useful to be able to load it up in the Prefab Editor so we could use the mod's custom objects in our prefabs. Like regional banners and farm animals.

Merci bien!

Request : Move objects by 0.025 units instead of freeform

Currently, moving models and billboards is freeform. Sometimes it can move by 0.01, others by 0.08. It would be beneficial for the construction of custom buildings to have the same settings as the world data editor, where objects are moved by 0.025 units.

Thanks!

Exception while spawning dynamic objects

Case 1

Player(5).log

LocationLoader.LocationLoader.InstantiateInstanceDynamicObjects (LocationLoader.LocationData locationData) (at <620436d85ff84a0cba71210666a700af>:0)
LocationLoader.LocationLoader.LocationData_OnLocationEnabled (System.Object sender, System.EventArgs _) (at <620436d85ff84a0cba71210666a700af>:0)
LocationLoader.LocationData.OnEnable () (at <620436d85ff84a0cba71210666a700af>:0)
UnityEngine.GameObject:SetActive(Boolean)
DaggerfallWorkshop.Game.PlayerEnterExit:EnableExteriorParent(Boolean)
DaggerfallWorkshop.Game.PlayerEnterExit:DungeonTransitionExteriorLogic()
DaggerfallWorkshop.Game.<FadedTransitionDungeonExterior>d__122:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Case 2

NullReferenceException: Object reference not set to an instance of an object
  at LocationLoader.LocationLoader.InstantiateInstanceDynamicObjects (LocationLoader.LocationData locationData) [0x0001e] in <620436d85ff84a0cba71210666a700af>:0 
  at LocationLoader.LocationLoader.LocationData_OnLocationEnabled (System.Object sender, System.EventArgs _) [0x00020] in <620436d85ff84a0cba71210666a700af>:0 
  at LocationLoader.LocationData.OnEnable () [0x00007] in <620436d85ff84a0cba71210666a700af>:0 
UnityEngine.GameObject:SetActive(Boolean)
DaggerfallWorkshop.Game.PlayerEnterExit:EnableExteriorParent(Boolean)
DaggerfallWorkshop.Game.PlayerEnterExit:BuildingTransitionExteriorLogic()
DaggerfallWorkshop.Game.<FadedTransitionExterior>d__110:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Rotating a prefab in the CSV does not change editor markers' position

I tested this with the Ladder Up/Down markers. When I rotated the prefab in the CSV file, the ladder up marker seems to have not moved, making the PC teleport in the air where the prefab is normally located when it's not rotated.

To test, you can use the border towers files I submitted as a PR and this save game attached to one such problematic prefab.
SAVE16.zip

[BUG] - Prefabs added from the object list always stay at coordinates 0, 0, 0

When you add a prefab as a new object and place it somewhere, the new coordinates are not registered when you save the prefab and load it again.

To reproduce :

  • Create a new prefab
  • Import a prefab of your choice as a new object and place it somewhere else than 0, 0, 0
  • Save and reload. The prefab you placed will have returned to 0, 0, 0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.