View Issue Details

IDProjectCategoryView StatusLast Update
0005373Spring engineLuapublic2017-05-01 09:55
ReporterStickyStains Assigned ToKloot  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version103.0 
Summary0005373: Script loading error
DescriptionI have two units, the jgeohive and the gzombspawner.
Both load the same script jgeohive.lua.

Both units have identical UnitDefs,except for the models.

On load, the jgeohive will perfectly execute the script, the gzombspawner will refuse to load/run the script. (Create is not reached)

This doesnt seem to apply if the scripts are named diffently, aka are not having a UnitsName.

Additional InformationInfolog at:

http://pastebin.com/i6M0KxS1
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

Kloot

2017-05-01 00:05

developer   ~0017547

https://github.com/spring/spring/blob/develop/cont/base/springcontent/LuaGadgets/Gadgets/unit_script.lua#L545

https://github.com/spring/spring/blob/develop/cont/base/springcontent/LuaGadgets/Gadgets/unit_script.lua#L513

script chunks are cached by unitDef.scriptName, i.e. only loaded once.

hokomoko

2017-05-01 00:11

developer   ~0017548

the chunks are loaded once, but that's not the report.
Create should run in both units
https://github.com/spring/spring/blob/develop/cont/base/springcontent/LuaGadgets/Gadgets/unit_script.lua#L792

as it does in S44 (which has a similar unit_script.lua)

Kloot

2017-05-01 01:11

developer   ~0017549

Last edited: 2017-05-01 01:14

it's at least half the report, if "the gzombspawner will refuse to load" and "doesnt seem to apply if the scripts are named diffently" are taken literally.

regardless, hacking two ZK unitdefs to reference the same script containing just

  function script.Create()
    print("unitID=" .. unitID)
  end

did not reproduce the no-Create part for me (with either base-content or ZK's version of unit_script) and I have no inclination to dive deeper.

hokomoko

2017-05-01 09:55

developer   ~0017550

I agree, without code this is useless

Issue History

Date Modified Username Field Change
2016-10-15 12:12 StickyStains New Issue
2017-05-01 00:05 Kloot Assigned To => Kloot
2017-05-01 00:05 Kloot Status new => closed
2017-05-01 00:05 Kloot Resolution open => no change required
2017-05-01 00:05 Kloot Note Added: 0017547
2017-05-01 00:11 hokomoko Note Added: 0017548
2017-05-01 01:11 Kloot Note Added: 0017549
2017-05-01 01:14 Kloot Note Edited: 0017549
2017-05-01 09:55 hokomoko Note Added: 0017550