Skip to content

Commit

Permalink
chore(package): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed Aug 26, 2023
1 parent 22b3e70 commit 9e981ea
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 56 deletions.
18 changes: 18 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@ levelIdx=1
outputDir=C:\\Program\ Files\\Arx\ Libertatis\\

seed=12345

# can be either "normal" or "premium"
# the default value is "normal"
variant=normal

# can be either "true" or "false"
# the default value is "true"
# if the map has no light entities, then the value will get
# overriden to be false
calculateLighting=true

# can be either "production" or "development"
# the default value is "production"
mode=production

# points to the pkware-test-files repo's folder
# default value is "../pkware-test-files"
originalLevelFiles=../pkware-test-files
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
"node": ">=18.0.0"
},
"scripts": {
"dev": "npm run generate && npm run rungame",
"generate": "tsc && tsc-alias && node -r dotenv/config ./dist/src/index.js",
"rungame": "~/projektek/arx/ArxLibertatis/build/arx --loadlevel 1"
"generate": "tsc && tsc-alias && node ./dist/src/index.js",
"generate:with-dotenv": "tsc && tsc-alias && node -r dotenv/config ./dist/src/index.js",
"rungame": "~/projektek/arx/insanity/ArxLibertatis/build/arx --loadlevel 1",
"rungame:noclip": "~/projektek/arx/insanity/ArxLibertatis/build/arx --loadlevel 1 --noclip",
"dev": "npm run generate:with-dotenv && npm run rungame",
"dev:noclip": "npm run generate:with-dotenv && npm run rungame:noclip",
"prod": "export mode=\"production\" && npm run generate:with-dotenv && npm run rungame",
"release:normal": "npm run generate"
},
"repository": {
"type": "git",
Expand All @@ -27,15 +32,15 @@
},
"homepage": "https://github.com/meszaros-lajos-gyorgy/arx-map-ambience-gallery#readme",
"dependencies": {
"arx-level-generator": "^1.1.0",
"arx-level-generator": "^1.10.1",
"dotenv": "^16.3.1",
"three": "^0.155.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/node": "^20.4.9",
"@types/three": "^0.155.0",
"@types/node": "^20.5.6",
"@types/three": "^0.155.1",
"tsc-alias": "^1.8.7",
"typescript": "^5.1.6"
"typescript": "^5.2.2"
}
}
4 changes: 4 additions & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ declare global {
outputDir?: string
levelIdx?: string
seed?: string
variant?: string
calculateLighting?: string
mode?: string
originalLevelFiles?: string
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { Interactivity } from 'arx-level-generator/scripting/properties'
import { createLight, createZone } from 'arx-level-generator/tools'
import { loadOBJ } from 'arx-level-generator/tools/mesh'
import { applyTransformations, compile } from 'arx-level-generator/utils'
import { applyTransformations } from 'arx-level-generator/utils'
import { times } from 'arx-level-generator/utils/faux-ramda'
import { pickRandom, randomBetween } from 'arx-level-generator/utils/random'
import { MathUtils } from 'three'
Expand All @@ -30,12 +30,15 @@ const settings = new Settings({
levelIdx: parseInt(process.env.levelIdx ?? '1'),
outputDir: process.env.outputDir,
seed: process.env.seed,
variant: process.env.variant === 'premium' ? 'premium' : 'normal',
calculateLighting: process.env.calculateLighting === 'false' ? false : true,
mode: process.env.mode === 'development' ? 'development' : 'production',
originalLevelFiles: process.env.originalLevelFiles,
})

// ------------------------

const map = new ArxMap()
map.meta.mapName = 'Ambience Gallery'
map.config.offset = new Vector3(2000, 0, 2000)
map.player.position.adjustToPlayerHeight()
map.player.orientation.y = MathUtils.degToRad(-90)
Expand Down Expand Up @@ -170,7 +173,7 @@ smoothMeshes.flat().forEach((mesh) => {
const tree = await loadOBJ('models/tree/tree', {
position: new Vector3(4770, -10, 1450),
scale: new Vector3(0.8, 0.7, 0.8),
rotation: new Rotation(0, MathUtils.degToRad(70), 0),
orientation: new Rotation(0, MathUtils.degToRad(70), 0),
fallbackTexture: Texture.l2TrollWoodPillar08,
})

Expand All @@ -185,6 +188,4 @@ importedModels.forEach((mesh) => {
map.finalize()
await map.saveToDisk(settings)

await compile(settings)

console.log('done')

0 comments on commit 9e981ea

Please sign in to comment.