Jump to content

Help with migrating maps to 0.28.0


Recommended Posts

53 minutes ago, hyperion said:

Would be nice if you actually copied the error message as text (the image doesn't load for me) so a blind guess is you use SetProgress instead of yield.

the image is this:

556489961-e67502cb-b4ae-4e1f-9eb1-4016eba5fac5.png.7e4b519071d5599cbbcb60ce95a1fbd0.png

Link to comment
Share on other sites

You need to import the functions you are using something like

import { addAnimals, addBerries, addBluffs, addDecoration, addForests, addHills, addLayeredPatches,
	addMetal, addStone, addStragglerTrees, createBluffsPassages, markPlayerAvoidanceArea } from
	"maps/random/rmgen2/gaia.js";
  • Thanks 1
Link to comment
Share on other sites

11 hours ago, phosit said:

You need to import the functions you are using something like

import { addAnimals, addBerries, addBluffs, addDecoration, addForests, addHills, addLayeredPatches,
	addMetal, addStone, addStragglerTrees, createBluffsPassages, markPlayerAvoidanceArea } from
	"maps/random/rmgen2/gaia.js";

@phositWhen I uncomment the line `Engine.LoadLibrary("rmgen2");`  I get the error:

 

ERROR: JavaScript error: maps/random/rmgen2/gaia.js line 1
import declarations may only appear at top level of a module
  @maps/random/cliffs_of_carnage.js:7:8
ERROR: CMapGenerationCallbacks::LoadScripts: Failed to load script 'maps/random/rmgen2/gaia.js'
ERROR: An unhandled promise got rejected:
ReferenceError: e_p is not defined
@maps/random/cliffs_of_carnage.js:386:1

@Stan`What's the link to the porting guide?

Link to comment
Share on other sites

5 minutes ago, andy5995 said:

@phositWhen I uncomment the line `Engine.LoadLibrary("rmgen2");`  I get the error:

 

ERROR: JavaScript error: maps/random/rmgen2/gaia.js line 1
import declarations may only appear at top level of a module
  @maps/random/cliffs_of_carnage.js:7:8
ERROR: CMapGenerationCallbacks::LoadScripts: Failed to load script 'maps/random/rmgen2/gaia.js'
ERROR: An unhandled promise got rejected:
ReferenceError: e_p is not defined
@maps/random/cliffs_of_carnage.js:386:1

@Stan`What's the link to the porting guide?

Oh, I think I see. I'll start with a change like this: https://gitea.wildfiregames.com/0ad/0ad/commit/2d43ca6462940e9c3aad82309e41febb53892654?files=binaries%2fdata%2fmods%2fpublic%2fmaps%2frandom%2ffrontier.js

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...