Opened 10 years ago
Last modified 10 years ago
#2517 closed enhancement
Register all component classes as global — at Version 7
Reported by: | sanderd17 | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 17 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
When someone makes a mod now, they have to copy the entire component over to their mod (which can be quite hard to maintain).
By registering all components as a global, mods can just extend functionality from the existing prototype in the public mod by doing that in a different file that's loaded afterwards (f.e. by creating an Attack.MyMod.js file to extend the Attack prototype defined in Attack.js).
There's a separate Engine function now to register variables as global (Engine.RegisterGlobal(name, var)), but it would be better to put this functionality inside the Engine.RegisterComponentType() method, so the actual JS components don't have to be modified.
As the schema gets saved to the Engine on RegisterComponentType, we should also allow to register the same component multiple times to allow schema overriding by mods (this might be less simple than the other part to get it right).
Change History (7)
comment:1 by , 10 years ago
comment:3 by , 10 years ago
Replying to sanderd17:
Apparently not
But I extended the Aristeia scripts like the way you described, and no errors are thrown...
follow-up: 5 comment:4 by , 10 years ago
That's strange. It didn't work for me. It rather was random. Did you test the healing priests/converter unit after your changes?
(that's the only unit that uses the Convert Attack. Which for me didn't work.)
comment:5 by , 10 years ago
Replying to Radagast:
That's strange. It didn't work for me. It rather was random. Did you test the healing priests/converter unit after your changes?
(that's the only unit that uses the Convert Attack. Which for me didn't work.)
No, I did only test the cheat.
comment:7 by , 10 years ago
Description: | modified (diff) |
---|
Didn't it work already?