Posted: 18th Jun 2023 0:50
Hi, this is more of a Linux question, and my knowledge is very limited. I finally got ARCH Linux working after following this guide: https://itsfoss.com/install-arch-linux/

I was able to download AppGameKit on Steam, and now I want to open my old project. I copied the folder over to the "Desktop" folder under my username, but nothing is there when I try to open a project in AGK. It says I am on the Desktop of the same user, but clearly it is a different user as there are no files there. I was able to just copy and paste the text and it's running smooth with blank assets, but I can't find the folder to copy over the assets.

Happy that AppGameKit can compile Linux programs, but I really have no idea how to open/find my old project from file --> Open Project. I missing something simple? Thanks.

EDIT: I also can't find the new project I created using the GNOME file explorer to put the media in that way.
Posted: 20th Jun 2023 6:11
The clarify the question:

Is there some way to switch users or something when opening a project in AppGameKit on Linux? I only have 1 user login and it says I am looking at the right directory on that user's profile, but it's not there. I also logged in as root user and I can't find anything. I am running AppGameKit from Linux Steam. Hope that helps. Thanks.
Posted: 29th Jun 2023 5:00
Not sure I follow the question, but here are some thoughts
1. Do you see the folder from a console? Ls -la
2. Linux is case sensitive e.g. Documents and documents are two different folders
3. A. .foldername would make it hidden.

Don't know much about Arch Linux, but. It does not seem like it would be a different user issue. Seems more like a hidden issue, or permission issue on the folder. May need to run a chgrp / chown on your folder recursively
Posted: 29th Jun 2023 19:34
Nice! I will definitely try that when I get back home to my Linux burner laptop August 3rd and get back to you. Thanks.

EDIT: It was working great when I just copy/pasted the code into a new project. I just could not figure out how to open a project I moved over to the hard drive or do the Open With... thing that you can do in Windows.
Posted: 9th Jul 2023 12:44
Was able to load the project on a different computer with Ubuntu Mint in AppGameKit and compile it, but unfortunately it won't run. A black window loads and I get a popup saying Force Close or Wait, then eventually it crashes. Probably has to do with loading the assets. I'll test it out more tomorrow.

Also, I'll get back home early August to try loading the project on the ARCH Linux computer. The code I copy/pasted ran fine on that one, but all the assets were blank due to unresolved issue in original post. I'll post here when I get back.
Posted: 14th Jul 2023 5:28
I still haven't gotten back to the ARCH Linux computer, but I'm trying to run it on Ubuntu with less success. On ARCH, the code was compiling fine, but I couldn't find the project folder to use graphical assets, possibly because I installed Linux wrong. I won't get back to work on that till August.

Meanwhile, I have access to two Ubuntu computers and I'm compiling it from AppGameKit on Steam. It always compiles, but it crashes about half-way through my function that declares variables, and it brings up a Close or Wait prompt. The crash happens around the objParent declaration, so I'm guessing it just can't handle that many variables. That sucks, because my DarkBASIC Pro game is running fine on Linux using Steam Proton. I switched to AppGameKit for the Linux compatibility. The tragic irony.

+ Code Snippet
global breakLoop					`1=Break main game loop and return to main menu.
global ticks						`Call map script and advance time every 180 ticks.
global ticksMech					`Update game mechanics every 3 ticks.
global storyName$					`Name of current story/chapter.
global storyFail					`1=Main story has failed and saving has been disabled.
global touchScreen					`Touchscreen mode (set in code only).
global demoVersion					`Demo version (first 5 maps only).
global linuxVersion					`Linux verison (disable File Explore plugin).
global worldEditor					`World Editor enabled.
global editorMode					`1=Editor mode is turned on.
global editorX						`Selected tile X in editor mode.
global editorY						`Selected tile Y in editor mode.
global editorLast$					`Last edit string input.
global checkX						`Temp variable for pathfinding.
global checkY						`Temp variable for pathfinding.
global mapGen						`Temp variable for map generator.
global time 						`Time of day (1 to 600).
global days							`Days passed in current story.
global gameOverCnt					`Game over countdown (60 ticks, or 1 second).
global map							`Currently loaded map.
global mapDrawn						`Map already drawn (cut out messages/sounds beforehand).
global dialogWin					`Dialogue window is currently open.
global camX#						`Camera position X.
global camY#						`Camera position Y.
global camZoom#						`Camera zoom.
global numImages					`Number of images.
global numObj						`Number of objects.
global numMob						`Number of mobile objects.
global keyDelay						`Delay after pressing certain keys.
global paused						`Pause game (0=no, 1=yes, 2=editor, 3=item target, 4=ability target).
global command						`Command (0=move, 1=get/use, 2=talk, 3=look, 4=attack).
global menuSettings					`Selected option in settings menu (0 to 10).
global msgSize						`Message window size (1=big).
global mouseHold					`Left mouse button is held (for drag selection).
global mouseXSel					`Drag selection start X.
global mouseYSel					`Drag selection start Y.
global mouseXOld					`Old mouse X (for tool tips).
global mouseYOld					`Old mouse Y (for tool tips).
global mouseStill					`Ticks passed since last mouse movement (for tool tips).
global journalTab					`Current journal tab (0=quests, 1=reputation, 2=options).
global wealth						`Player's wealth.
global points						`Player's skill points.
global partyLvl						`Party Level = (size*5) + total karma spent.
global weather$						`Current weather (0=clear, 1=rain, 2=snow, 3=fog, 4=hail).
global weatherX						`Current X position of weather overlay.
global weatherY						`Current Y position of weather overlay.
global weatherMoveX					`X movement of weather overlay.
global weatherMoveY					`Y movement of weather overlay.
global weatherOpacity				`Opacity of weather overlay (0 to 100).
global weatherGlue					`Weather overlay doesn't move with screen scrolling.
global weatherAim					`Aim modifier for map (usually based on weather).
global screen$						`Current background scene (for maps, etc.).
global dialog$						`Dialogue text (if not blank, game is in dialogue).
global response$					`Player's response to dialog window.
global command$						`Script command.
global value$						`Script parameter (complete).
global val1$						`Script parameter #1.
global val2$						`Script parameter #2.
global targX						`Current X target (for item and ability targets).
global targY						`Current Y target (for item and ability targets).
global shop							`If 1, player is currently shopping.
global shopInv						`Selected inventory slot while shopping.
global game$						`Selected save/story in main menu.
global ambOld$						`Old ambient sound (for changing ambience).
global musOld$						`Old music (for changing music).
global gameoverScr$					`Script to run on gameover (reset when map changes).
global victoryMusic					`If 1, short victory music is currently playing.
global cursor$						`Current custom cursor (leave blank for default).
global hideHUD						`If 1, HUD is currently hidden (H key).
global playerObj					`Object ID of main player (gameover if dead).
global playerMap					`Map ID of main player (for world editor only).
global curObj						`Currently-selected object for scripts.
global lstObj						`Last currently-selected object for nested scripts.
global defObj						`Default object that triggered current script.
global itmObj						`Item currently being used for paused targeting.
global trgObj						`Party mobile that is currently in targeting mode.
global menuSound					`Temp sound variable for returning to main menu.
global menuMusic					`Temp music variable for returning to main menu.
global settingsAI					`Party AI level (0-2).
global settingsMusic				`Music volume (0-3).
global settingsSound				`Sound volume (0-3).
global settingsTips					`Tool tip speed (0-3, 0=off).
global settingsGlint				`Item glint frequency (0-3, 0=off).
global settingsScreen				`Fullscreen mode (1=on).
`Basic arrays.
dim mapNumObj[999]					`Number of objects on map.
dim checkTemp[10000]				`Temp object checks for script commands like "pickName".
dim itemCount[10000]				`Temp check for player picking up multiple items at once.
dim image$[9999]					`Image filenames.
dim message$[20]					`Game messages.
dim storyList$[20]					`Temp list for list of stories and saves.
dim var[999]						`Game variables for scripts.
dim partyRoster[25]					`Up to 25 party members (5 main, 20 henchmen).
dim missileX#[10]					`Up to 5 missiles at once (X destination).
dim missileY#[10]					`Up to 5 missiles at once (Y destination).
dim choices$[6]						`Up to 6 max choices in dialogue windows.
dim lines$[6]						`Up to 6 lines of text (using /r to go to next line).
dim locked$[20]						`List of locked stories (chapters).
`Game constants (globals script).
global pacesName$					`Name of tile units.
global weightName$					`Name of weight units.
global wealthName$					`Name of wealth units.
global pointsName$					`Name of point units.
global healthName$					`Name of health units.
global metaName$					`Name of meta units.
dim damageName$[10]					`Names of the 10 types of damage (melee, etc.).
dim factionName$[10]				`Names of the 10 factions (0=neutral, 1=player).
dim factionReact[10]				`Reaction of faction towards player (0-100).
dim reputations$[100]				`Party reputations (carried over to other chapters).
dim objectives$[100]				`Party objectives (not carried over to other chapters).
`Skill/Ability properties.
dim skillName$[10]					`Skill name.
dim abilityName$[100]				`Ability name.
dim abilityImg$[100]				`Ability icon.
dim abilityDesc$[100]				`Ability description.
dim abilityTarg[100]				`Ability target (0=passive, 1=self, 2=other).
dim abilityRange[100]				`Ability range.
dim abilityCost[100]				`Ability meta cost to use.
dim abilityScr$[100]				`Ability script.
dim abilityReq[100,1]				`Ability required skill (2nd dim is amount).
`Effect properties.
`Bonus Attributes: 1-10=Resist, 11=Max Health, 12=Max Energy,
`13=Max Load, 14=Damage, 15=Evasion, 16=Aiming.
dim statusName$[50]					`Names of the 10 mobile effects (poison, etc.).
dim statusMax[50]					`Max level of effect (up to 100).
dim statusDam[50]					`Health damage every 3 seconds (negative for heal).
dim statusDType[50]					`Health damage type every 3 seconds.
dim statusDrain[50]					`Meta drain every 3 seconds.
dim statusSpeed[50]					`Speed adjustment (-4 to 4).
dim statusConfused[50]				`If 1, mobile walks in random directions occasionally.
dim statusBerserk[50]				`If 1, mobile automatically attacks adjascent mobiles.
dim statusSleeping[50]				`If 1, mobile is asleep.
dim statusConcealed[50]				`If 1, mobile is concealed from sight.
dim statusSpotting[50]				`If 1, mobile is can see concealed objects.
dim statusNoTip[50]					`If 1, status is not shown in tooltips.
dim statusBonus[50,1]				`Effect attribute bonus (if 2nd dim=1 then decrease).
dim statusBonus2[50,1]				`2nd effect increases attribute (if 2nd dim=1 then decrease).
dim statusRed[50]					`Red color correction for object with this status.
dim statusGreen[50]					`Green color correction for object with this status.
dim statusBlue[50]					`Blue color correction for object with this status.
dim statusRecover#[50]				`If 1, effect decreases every second, if -1 it increases.
`Map properties.
dim mapName$[999]					`Name of map.
dim mapSizeX[999]					`Map size X (30 to 100).
dim mapSizeY[999]					`Map size Y (30 to 100).
dim mapTile$[100,100,999]			`Map terrain PNG tile (x, y, map).
dim mapBlock[100,100,999]			`Tile blocks movement (1=yes).
dim mapBlockFly[100,100,999]		`Tile blocks flying (1=yes).
dim mapBlockVis[100,100,999]		`Tile blocks sight (1=yes).
dim mapDrawPri[100,100,999]			`Tile draws over non-flying objects (1=yes).
dim mapWater[100,100,999]			`Tile requires swimming (1=yes).
dim mapIndoors[100,100,999]			`Tile is indoors (1=yes).
dim mapMusic$[999]					`Map music during the day.
dim mapMusicNight$[999]				`Map music during the night.
dim mapAmbient$[999]				`Map ambient during the day.
dim mapAmbientNight$[999]			`Map ambient during the night.
dim mapScr$[999]					`Map script, run every 3 seconds.
dim mapRed[999]						`Map red tint (0-255).
dim mapGreen[999]					`Map green tint (0-255).
dim mapBlue[999]					`Map blue tint (0-255).
dim mapNoNight[999]					`Map day/night cycle disabled if 1.
`Object properties.
dim objName$[10000,999]				`Name of object (blank=none).
dim objImg$[10000,999]				`Image filename (PNG).
dim objMat$[10000,999]				`Material of object.
dim objDesc$[10000,999]				`Description of object.
dim objEdit[10000,999]				`If 1, object is only visible in Editor mode (waypoints).
dim objType[10000,999]				`Type (0=normal, 1=item, 2=mobile, 3=usable, 4=effect).
dim objPosX[10000,999]				`Position X.
dim objPosY[10000,999]				`Position Y.
dim objDestX[10000,999]				`Current X destination.
dim objDestY[10000,999]				`Current Y destination.
dim objDestXTemp[10000,999]			`Temp X destination (for collision avoidance).
dim objDestYTemp[10000,999]			`Temp Y destination (for collision avoidance).
dim objHE[10000,999]				`Current health/condition of object.
dim objHEMax[10000,999]				`Max health/condition of object.
dim objME[10000,999]				`Current meta/charges of object.
dim objMEMax[10000,999]				`Max meta/charges of object.
dim objLoadMax[10000,999]			`Max load object can carry/contain.
dim objInv[10000,10,999]			`Object's inventory/contents.
dim objEquip[10000,999]				`Currently equipped item slot (1-20).
dim objRes[10000,10,999]			`Object's resistance to the 10 types of damage.
dim objTable[10000,999]				`If 1, object acts as a table.
dim objBlock[10000,999]				`Object blocks movement (1=yes).
dim objBlockFly[10000,999]			`Object blocks flying (1=yes).
dim objBlockVis[10000,999]			`Object blocks sight (1=yes).
dim objColX[10000,999]				`X collision size (odd numbers only).
dim objColY[10000,999]				`Y collision size.
dim objSelX[10000,999]				`X selection size.
dim objSelY[10000,999]				`Y selection size.
dim objFlip[10000,999]				`Object sprite flipped horizontally.
dim objDrawPri[10000,999]			`Draw (0=normal, 1=over, 2=under, 3=bottom).
dim objConcealed[10000,999]			`Object hidden (only visible with spotting status effect).
dim objFaction[10000,999]			`Object faction (0-10, 0=none, 1=player).
dim objSpeed[10000,999]				`Mobile's pixels object moves each tick (max=5).
dim objTemp[10000,999]				`If 1, object is deleted after leaving map (blood+vomit).
dim objFrameSize[10000,999]			`X+Y pixel size of each frame in sprite sheet.
dim objParent[10000,999]			`Parent object (for inventory mostly).
dim objWaypoint[10000,999]			`Object acts as a waypoint for AI (doorways, etc.).
dim objScrUse$[10000,999]			`Object use script.
dim objScrAtt$[10000,999]			`Object attack script.
dim objScrGet$[10000,999]			`Object get script.
dim objScrDrp$[10000,999]			`Object drop script.
dim objScrDam$[10000,999]			`Object damage script.
dim objScrDie$[10000,999]			`Object death script.
dim objScrCol$[10000,999]			`Object collision script.
dim objScrSel$[10000,999]			`Object select script.
dim objScrChk$[10000,999]			`Object AI check script (run every second).
`Item properties.
dim objItmType[10000,999]			`Item type (0=none, 1=useable, 2=weapon).
dim objItmTarg[10000,999]			`Item target type (0=self, 1=other).
dim objItmCnt[10000,999]			`Item count (max=100, only if HE and ME are <1).
dim objItmSpr$[10000,999]			`Item overlay on mobile sprite when equipped.
dim objItmWeight[10000,999]			`Item weight.
dim objItmAnim[10000,999]			`Item use anim (0-6).
dim objItmDelay[10000,999]			`Item use speed.
dim objItmDam[10000,999]			`Weapon base damage.
dim objItmDType[10000,999]			`Weapon damage type.
dim objItmRange[10000,999]			`Weapon range.
dim objItmAim[10000,999]			`Weapon ranged aim.
dim objItmAmmo[10000,999]			`Ammo type for weapons.
dim objItmAmmoReq[10000,999]		`Required ammo.
dim objItmWpnType$[10000,999]		`Weapon type (for ability scripts only).
dim objItmValue[10000,999]			`Value of item at merchants.
`Mobile properties.
`Mobile tasks: 0=Idle, 1=Use, 2=Thrust, 3=Walk, 4=Slash, 5=Shoot, 6=Die.
`Mobile skills: 1=Vitality, 2=Willpower, 3=Physique, 4=Cunning, 5=Education.
dim objMobDir[10000,999]			`Mobile's direction (0=N, 1=S. 2=E, 3=W).
dim objMobTask[10000,999]			`Mobile's current task (0-6).
dim objMobSpecies$[10000,999]		`Mobile's species.
dim objMobSkill[10000,20,999]		`Mobile's skills (0-20).
dim objMobAbility[10000,10,999]		`Mobile's abilities (each one set to an ability ID#).
dim objMobStatus#[10000,50,999]		`Mobile's level of each status effect.
dim objMobDType[10000,999]			`Mobile's unarmed damage type.
dim objMobRange[10000,999]			`Mobile's unarmed range.
dim objMobSwim[10000,999]			`Mobile's pixels object swims each tick (max=5).
dim objMobMelee[10000,999]			`Mobile's bonus melee damage.
dim objMobAiming[10000,999]			`Mobile's ranged aiming bonus.
dim objMobEvade[10000,999]			`Mobile's evasion percent chance.
dim objMobAquatic[10000,999]		`Mobile can swim if 1, water only if 2, sand only if 3.
dim objMobFlying[10000,999]			`Mobile is flying.
dim objMobFlee[10000,999]			`Mobile flees at given health percent.
dim objMobInParty[10000,999]		`Mobile is a main player (2=mobile is a henchman).
dim objMobAb[10000,999]				`Mobile's currently selected ability.
`Effect properties.
dim objEffLife[10000,999]			`Effect's lifespan (0=infinite).
dim objEffRange[10000,999]			`Effect's range (affects nearby tiles).
dim objEffSpeed[10000,999]			`Effect's animation speed (unrelated to move speed).
dim objEffFadeOut[10000,999]		`If 1, effect fades out when its life runs out.
dim objEffNoParent[10000,999]		`If 1, effect does not affect parent object.
`Mobile animation frames.
`Dim2: 0=start, 1=end.
dim objAnimIdleN[10000,1,999]		`Idle animation frames (facing north).
dim objAnimIdleS[10000,1,999]		`Idle animation frames (facing south).
dim objAnimIdleE[10000,1,999]		`Idle animation frames (facing east).
dim objAnimIdleW[10000,1,999]		`Idle animation frames (facing west).
dim objAnimUseN[10000,1,999]		`Item/magic animation frames (facing north).
dim objAnimUseS[10000,1,999]		`Item/magic animation frames (facing south).
dim objAnimUseE[10000,1,999]		`Item/magic animation frames (facing east).
dim objAnimUseW[10000,1,999]		`Item/magic animation frames (facing west).
dim objAnimThrustN[10000,1,999]		`Thrust animation frames (facing north).
dim objAnimThrustS[10000,1,999]		`Thrust animation frames (facing south).
dim objAnimThrustE[10000,1,999]		`Thrust animation frames (facing east).
dim objAnimThrustW[10000,1,999]		`Thrust animation frames (facing west).
dim objAnimWalkN[10000,1,999]		`Walk animation frames (facing north).
dim objAnimWalkS[10000,1,999]		`Walk animation frames (facing south).
dim objAnimWalkE[10000,1,999]		`Walk animation frames (facing east).
dim objAnimWalkW[10000,1,999]		`Walk animation frames (facing west).
dim objAnimSlashN[10000,1,999]		`Slash animation frames (facing north).
dim objAnimSlashS[10000,1,999]		`Slash animation frames (facing south).
dim objAnimSlashE[10000,1,999]		`Slash animation frames (facing east).
dim objAnimSlashW[10000,1,999]		`Slash animation frames (facing west).
dim objAnimShootN[10000,1,999]		`Shoot animation frames (facing north).
dim objAnimShootS[10000,1,999]		`Shoot animation frames (facing south).
dim objAnimShootE[10000,1,999]		`Shoot animation frames (facing east).
dim objAnimShootW[10000,1,999]		`Shoot animation frames (facing west).
dim objAnimDeath[10000,1,999]		`Death animation.
`Temp variables for current map.
dim objSelected[10000]				`Mobile is currently selected.
dim objTransX[10000]				`Temporary X transition to next tile.
dim objTransY[10000]				`Temporary Y transition to next tile.
dim objSpriteHUD[10000]				`Selection sprites attached to mobile (1-25).
dim objDirOld[10000]				`Previous direction of object.
dim objDelay[10000]					`Object delay (negative for script timers).
dim objChecks[10000]				`Passive checks every second (usually for AI).
dim objMobCmd[10000]				`Mobile object's current command.
dim objMobTarg[10000]				`Mobile's current target (use, get, or attack).
dim objMobPathX[10000,5]			`Mobile pathfinding steps, X.
dim objMobPathY[10000,5]			`Mobile pathfinding steps, Y.
dim objEffDie[10000]				`Effect object shrinkage on death (30 frames).
Posted: 14th Jul 2023 18:45
I am not really sure, I have never had that many variables defined before. I usually use Types (sometimes nested) in larger projects with the newer array definition (https://www.appgamekit.com/documentation/guides/12_array_changes.htm). I have also never used DB(P), so I am not sure there. I have been using both AppGameKit and Studio for years now under different versions of Ubuntu without issue. I guess you could try to debug it? I have also run steam from a shell terminal to see what type of errors pop up, not sure if you want to do that as well.
Posted: 14th Jul 2023 22:58
Those are some HUGE arrays
Posted: 15th Jul 2023 2:43
I recently increased the max number of maps from 100 to 999 in case modders wanna make huge open worlds. I don't really need that many cause I'm making NWN1-style chapters, but I'll test out 100 maps tonight, and also try types.
Posted: 15th Jul 2023 8:36
I decreased max maps down from 999 to 30 in the DIM arrays. The program is then just a blank screen, but it's not crashing.

Now I'm trying to use the new array declaration method without using types, like so: mapNumObj as integer[999]
It should work, but it's saying I haven't defined those arrays yet and won't compile.
Posted: 15th Jul 2023 15:35
The error message would help
Posted: 15th Jul 2023 19:28
"Blabla has not been defined as an array" (when I try to compile on Windows)
Posted: 15th Jul 2023 19:51
new array declaration method

i think you mean the examples HERE, none of which include Scope so are LOCAL by Default while DIM'd arrays are GLOBAL by Default (i think i just learned this. i never use DIM). So:
+ Code Snippet
myArray as integer[5]

...is Local &
+ Code Snippet
GLOBAL myArray as integer[5]

i believe is what you're looking for?
Posted: 15th Jul 2023 20:18
meanwhile, either open taskmanager and run this while watching memory usage change pre-DIM to post-:

+ Code Snippet
// Project: LCS Arrays 
// Created: 2023-07-15

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "LCS Arrays" )
SetWindowSize( 640,360, 0 )
SetWindowAllowResize( 1 )

// set display properties
SetVirtualResolution( 640,360 )
SetOrientationAllowed( 1, 1, 1, 1 ) // portrait, portrait2, landscape, landscape2
SetSyncRate( 30, 0 )
SetScissor( 0,0,0,0 )
UseNewDefaultFonts( 1 )

Repeat
	Print("Pre-DIM")
	Sync()
Until GetPointerPressed()
Print("POST-DIM")
Sync()

global breakLoop					`1=Break main game loop and return to main menu.
global ticks						`Call map script and advance time every 180 ticks.
global ticksMech					`Update game mechanics every 3 ticks.
global storyName$					`Name of current story/chapter.
global storyFail					`1=Main story has failed and saving has been disabled.
global touchScreen					`Touchscreen mode (set in code only).
global demoVersion					`Demo version (first 5 maps only).
global linuxVersion					`Linux verison (disable File Explore plugin).
global worldEditor					`World Editor enabled.
global editorMode					`1=Editor mode is turned on.
global editorX						`Selected tile X in editor mode.
global editorY						`Selected tile Y in editor mode.
global editorLast$					`Last edit string input.
global checkX						`Temp variable for pathfinding.
global checkY						`Temp variable for pathfinding.
global mapGen						`Temp variable for map generator.
global time 						`Time of day (1 to 600).
global days							`Days passed in current story.
global gameOverCnt					`Game over countdown (60 ticks, or 1 second).
global map							`Currently loaded map.
global mapDrawn						`Map already drawn (cut out messages/sounds beforehand).
global dialogWin					`Dialogue window is currently open.
global camX#						`Camera position X.
global camY#						`Camera position Y.
global camZoom#						`Camera zoom.
global numImages					`Number of images.
global numObj						`Number of objects.
global numMob						`Number of mobile objects.
global keyDelay						`Delay after pressing certain keys.
global paused						`Pause game (0=no, 1=yes, 2=editor, 3=item target, 4=ability target).
global command						`Command (0=move, 1=get/use, 2=talk, 3=look, 4=attack).
global menuSettings					`Selected option in settings menu (0 to 10).
global msgSize						`Message window size (1=big).
global mouseHold					`Left mouse button is held (for drag selection).
global mouseXSel					`Drag selection start X.
global mouseYSel					`Drag selection start Y.
global mouseXOld					`Old mouse X (for tool tips).
global mouseYOld					`Old mouse Y (for tool tips).
global mouseStill					`Ticks passed since last mouse movement (for tool tips).
global journalTab					`Current journal tab (0=quests, 1=reputation, 2=options).
global wealth						`Player's wealth.
global points						`Player's skill points.
global partyLvl						`Party Level = (size*5) + total karma spent.
global weather$						`Current weather (0=clear, 1=rain, 2=snow, 3=fog, 4=hail).
global weatherX						`Current X position of weather overlay.
global weatherY						`Current Y position of weather overlay.
global weatherMoveX					`X movement of weather overlay.
global weatherMoveY					`Y movement of weather overlay.
global weatherOpacity				`Opacity of weather overlay (0 to 100).
global weatherGlue					`Weather overlay doesn't move with screen scrolling.
global weatherAim					`Aim modifier for map (usually based on weather).
global screen$						`Current background scene (for maps, etc.).
global dialog$						`Dialogue text (if not blank, game is in dialogue).
global response$					`Player's response to dialog window.
global command$						`Script command.
global value$						`Script parameter (complete).
global val1$						`Script parameter #1.
global val2$						`Script parameter #2.
global targX						`Current X target (for item and ability targets).
global targY						`Current Y target (for item and ability targets).
global shop							`If 1, player is currently shopping.
global shopInv						`Selected inventory slot while shopping.
global game$						`Selected save/story in main menu.
global ambOld$						`Old ambient sound (for changing ambience).
global musOld$						`Old music (for changing music).
global gameoverScr$					`Script to run on gameover (reset when map changes).
global victoryMusic					`If 1, short victory music is currently playing.
global cursor$						`Current custom cursor (leave blank for default).
global hideHUD						`If 1, HUD is currently hidden (H key).
global playerObj					`Object ID of main player (gameover if dead).
global playerMap					`Map ID of main player (for world editor only).
global curObj						`Currently-selected object for scripts.
global lstObj						`Last currently-selected object for nested scripts.
global defObj						`Default object that triggered current script.
global itmObj						`Item currently being used for paused targeting.
global trgObj						`Party mobile that is currently in targeting mode.
global menuSound					`Temp sound variable for returning to main menu.
global menuMusic					`Temp music variable for returning to main menu.
global settingsAI					`Party AI level (0-2).
global settingsMusic				`Music volume (0-3).
global settingsSound				`Sound volume (0-3).
global settingsTips					`Tool tip speed (0-3, 0=off).
global settingsGlint				`Item glint frequency (0-3, 0=off).
global settingsScreen				`Fullscreen mode (1=on).
`Basic arrays.
dim mapNumObj[999]					`Number of objects on map.
dim checkTemp[10000]				`Temp object checks for script commands like "pickName".
dim itemCount[10000]				`Temp check for player picking up multiple items at once.
dim image$[9999]					`Image filenames.
dim message$[20]					`Game messages.
dim storyList$[20]					`Temp list for list of stories and saves.
dim var[999]						`Game variables for scripts.
dim partyRoster[25]					`Up to 25 party members (5 main, 20 henchmen).
dim missileX#[10]					`Up to 5 missiles at once (X destination).
dim missileY#[10]					`Up to 5 missiles at once (Y destination).
dim choices$[6]						`Up to 6 max choices in dialogue windows.
dim lines$[6]						`Up to 6 lines of text (using /r to go to next line).
dim locked$[20]						`List of locked stories (chapters).
`Game constants (globals script).
global pacesName$					`Name of tile units.
global weightName$					`Name of weight units.
global wealthName$					`Name of wealth units.
global pointsName$					`Name of point units.
global healthName$					`Name of health units.
global metaName$					`Name of meta units.
dim damageName$[10]					`Names of the 10 types of damage (melee, etc.).
dim factionName$[10]				`Names of the 10 factions (0=neutral, 1=player).
dim factionReact[10]				`Reaction of faction towards player (0-100).
dim reputations$[100]				`Party reputations (carried over to other chapters).
dim objectives$[100]				`Party objectives (not carried over to other chapters).
`Skill/Ability properties.
dim skillName$[10]					`Skill name.
dim abilityName$[100]				`Ability name.
dim abilityImg$[100]				`Ability icon.
dim abilityDesc$[100]				`Ability description.
dim abilityTarg[100]				`Ability target (0=passive, 1=self, 2=other).
dim abilityRange[100]				`Ability range.
dim abilityCost[100]				`Ability meta cost to use.
dim abilityScr$[100]				`Ability script.
dim abilityReq[100,1]				`Ability required skill (2nd dim is amount).
`Effect properties.
`Bonus Attributes: 1-10=Resist, 11=Max Health, 12=Max Energy,
`13=Max Load, 14=Damage, 15=Evasion, 16=Aiming.
dim statusName$[50]					`Names of the 10 mobile effects (poison, etc.).
dim statusMax[50]					`Max level of effect (up to 100).
dim statusDam[50]					`Health damage every 3 seconds (negative for heal).
dim statusDType[50]					`Health damage type every 3 seconds.
dim statusDrain[50]					`Meta drain every 3 seconds.
dim statusSpeed[50]					`Speed adjustment (-4 to 4).
dim statusConfused[50]				`If 1, mobile walks in random directions occasionally.
dim statusBerserk[50]				`If 1, mobile automatically attacks adjascent mobiles.
dim statusSleeping[50]				`If 1, mobile is asleep.
dim statusConcealed[50]				`If 1, mobile is concealed from sight.
dim statusSpotting[50]				`If 1, mobile is can see concealed objects.
dim statusNoTip[50]					`If 1, status is not shown in tooltips.
dim statusBonus[50,1]				`Effect attribute bonus (if 2nd dim=1 then decrease).
dim statusBonus2[50,1]				`2nd effect increases attribute (if 2nd dim=1 then decrease).
dim statusRed[50]					`Red color correction for object with this status.
dim statusGreen[50]					`Green color correction for object with this status.
dim statusBlue[50]					`Blue color correction for object with this status.
dim statusRecover#[50]				`If 1, effect decreases every second, if -1 it increases.
`Map properties.
dim mapName$[999]					`Name of map.
dim mapSizeX[999]					`Map size X (30 to 100).
dim mapSizeY[999]					`Map size Y (30 to 100).
dim mapTile$[100,100,999]			`Map terrain PNG tile (x, y, map).
dim mapBlock[100,100,999]			`Tile blocks movement (1=yes).
dim mapBlockFly[100,100,999]		`Tile blocks flying (1=yes).
dim mapBlockVis[100,100,999]		`Tile blocks sight (1=yes).
dim mapDrawPri[100,100,999]			`Tile draws over non-flying objects (1=yes).
dim mapWater[100,100,999]			`Tile requires swimming (1=yes).
dim mapIndoors[100,100,999]			`Tile is indoors (1=yes).
dim mapMusic$[999]					`Map music during the day.
dim mapMusicNight$[999]				`Map music during the night.
dim mapAmbient$[999]				`Map ambient during the day.
dim mapAmbientNight$[999]			`Map ambient during the night.
dim mapScr$[999]					`Map script, run every 3 seconds.
dim mapRed[999]						`Map red tint (0-255).
dim mapGreen[999]					`Map green tint (0-255).
dim mapBlue[999]					`Map blue tint (0-255).
dim mapNoNight[999]					`Map day/night cycle disabled if 1.
`Object properties.
dim objName$[10000,999]				`Name of object (blank=none).
dim objImg$[10000,999]				`Image filename (PNG).
dim objMat$[10000,999]				`Material of object.
dim objDesc$[10000,999]				`Description of object.
dim objEdit[10000,999]				`If 1, object is only visible in Editor mode (waypoints).
dim objType[10000,999]				`Type (0=normal, 1=item, 2=mobile, 3=usable, 4=effect).
dim objPosX[10000,999]				`Position X.
dim objPosY[10000,999]				`Position Y.
dim objDestX[10000,999]				`Current X destination.
dim objDestY[10000,999]				`Current Y destination.
dim objDestXTemp[10000,999]			`Temp X destination (for collision avoidance).
dim objDestYTemp[10000,999]			`Temp Y destination (for collision avoidance).
dim objHE[10000,999]				`Current health/condition of object.
dim objHEMax[10000,999]				`Max health/condition of object.
dim objME[10000,999]				`Current meta/charges of object.
dim objMEMax[10000,999]				`Max meta/charges of object.
dim objLoadMax[10000,999]			`Max load object can carry/contain.
dim objInv[10000,10,999]			`Object's inventory/contents.
dim objEquip[10000,999]				`Currently equipped item slot (1-20).
dim objRes[10000,10,999]			`Object's resistance to the 10 types of damage.
dim objTable[10000,999]				`If 1, object acts as a table.
dim objBlock[10000,999]				`Object blocks movement (1=yes).
dim objBlockFly[10000,999]			`Object blocks flying (1=yes).
dim objBlockVis[10000,999]			`Object blocks sight (1=yes).
dim objColX[10000,999]				`X collision size (odd numbers only).
dim objColY[10000,999]				`Y collision size.
dim objSelX[10000,999]				`X selection size.
dim objSelY[10000,999]				`Y selection size.
dim objFlip[10000,999]				`Object sprite flipped horizontally.
dim objDrawPri[10000,999]			`Draw (0=normal, 1=over, 2=under, 3=bottom).
dim objConcealed[10000,999]			`Object hidden (only visible with spotting status effect).
dim objFaction[10000,999]			`Object faction (0-10, 0=none, 1=player).
dim objSpeed[10000,999]				`Mobile's pixels object moves each tick (max=5).
dim objTemp[10000,999]				`If 1, object is deleted after leaving map (blood+vomit).
dim objFrameSize[10000,999]			`X+Y pixel size of each frame in sprite sheet.
dim objParent[10000,999]			`Parent object (for inventory mostly).
dim objWaypoint[10000,999]			`Object acts as a waypoint for AI (doorways, etc.).
dim objScrUse$[10000,999]			`Object use script.
dim objScrAtt$[10000,999]			`Object attack script.
dim objScrGet$[10000,999]			`Object get script.
dim objScrDrp$[10000,999]			`Object drop script.
dim objScrDam$[10000,999]			`Object damage script.
dim objScrDie$[10000,999]			`Object death script.
dim objScrCol$[10000,999]			`Object collision script.
dim objScrSel$[10000,999]			`Object select script.
dim objScrChk$[10000,999]			`Object AI check script (run every second).
`Item properties.
dim objItmType[10000,999]			`Item type (0=none, 1=useable, 2=weapon).
dim objItmTarg[10000,999]			`Item target type (0=self, 1=other).
dim objItmCnt[10000,999]			`Item count (max=100, only if HE and ME are <1).
dim objItmSpr$[10000,999]			`Item overlay on mobile sprite when equipped.
dim objItmWeight[10000,999]			`Item weight.
dim objItmAnim[10000,999]			`Item use anim (0-6).
dim objItmDelay[10000,999]			`Item use speed.
dim objItmDam[10000,999]			`Weapon base damage.
dim objItmDType[10000,999]			`Weapon damage type.
dim objItmRange[10000,999]			`Weapon range.
dim objItmAim[10000,999]			`Weapon ranged aim.
dim objItmAmmo[10000,999]			`Ammo type for weapons.
dim objItmAmmoReq[10000,999]		`Required ammo.
dim objItmWpnType$[10000,999]		`Weapon type (for ability scripts only).
dim objItmValue[10000,999]			`Value of item at merchants.
`Mobile properties.
`Mobile tasks: 0=Idle, 1=Use, 2=Thrust, 3=Walk, 4=Slash, 5=Shoot, 6=Die.
`Mobile skills: 1=Vitality, 2=Willpower, 3=Physique, 4=Cunning, 5=Education.
dim objMobDir[10000,999]			`Mobile's direction (0=N, 1=S. 2=E, 3=W).
dim objMobTask[10000,999]			`Mobile's current task (0-6).
dim objMobSpecies$[10000,999]		`Mobile's species.
dim objMobSkill[10000,20,999]		`Mobile's skills (0-20).
dim objMobAbility[10000,10,999]		`Mobile's abilities (each one set to an ability ID#).
dim objMobStatus#[10000,50,999]		`Mobile's level of each status effect.
dim objMobDType[10000,999]			`Mobile's unarmed damage type.
dim objMobRange[10000,999]			`Mobile's unarmed range.
dim objMobSwim[10000,999]			`Mobile's pixels object swims each tick (max=5).
dim objMobMelee[10000,999]			`Mobile's bonus melee damage.
dim objMobAiming[10000,999]			`Mobile's ranged aiming bonus.
dim objMobEvade[10000,999]			`Mobile's evasion percent chance.
dim objMobAquatic[10000,999]		`Mobile can swim if 1, water only if 2, sand only if 3.
dim objMobFlying[10000,999]			`Mobile is flying.
dim objMobFlee[10000,999]			`Mobile flees at given health percent.
dim objMobInParty[10000,999]		`Mobile is a main player (2=mobile is a henchman).
dim objMobAb[10000,999]				`Mobile's currently selected ability.
`Effect properties.
dim objEffLife[10000,999]			`Effect's lifespan (0=infinite).
dim objEffRange[10000,999]			`Effect's range (affects nearby tiles).
dim objEffSpeed[10000,999]			`Effect's animation speed (unrelated to move speed).
dim objEffFadeOut[10000,999]		`If 1, effect fades out when its life runs out.
dim objEffNoParent[10000,999]		`If 1, effect does not affect parent object.
`Mobile animation frames.
`Dim2: 0=start, 1=end.
dim objAnimIdleN[10000,1,999]		`Idle animation frames (facing north).
dim objAnimIdleS[10000,1,999]		`Idle animation frames (facing south).
dim objAnimIdleE[10000,1,999]		`Idle animation frames (facing east).
dim objAnimIdleW[10000,1,999]		`Idle animation frames (facing west).
dim objAnimUseN[10000,1,999]		`Item/magic animation frames (facing north).
dim objAnimUseS[10000,1,999]		`Item/magic animation frames (facing south).
dim objAnimUseE[10000,1,999]		`Item/magic animation frames (facing east).
dim objAnimUseW[10000,1,999]		`Item/magic animation frames (facing west).
dim objAnimThrustN[10000,1,999]		`Thrust animation frames (facing north).
dim objAnimThrustS[10000,1,999]		`Thrust animation frames (facing south).
dim objAnimThrustE[10000,1,999]		`Thrust animation frames (facing east).
dim objAnimThrustW[10000,1,999]		`Thrust animation frames (facing west).
dim objAnimWalkN[10000,1,999]		`Walk animation frames (facing north).
dim objAnimWalkS[10000,1,999]		`Walk animation frames (facing south).
dim objAnimWalkE[10000,1,999]		`Walk animation frames (facing east).
dim objAnimWalkW[10000,1,999]		`Walk animation frames (facing west).
dim objAnimSlashN[10000,1,999]		`Slash animation frames (facing north).
dim objAnimSlashS[10000,1,999]		`Slash animation frames (facing south).
dim objAnimSlashE[10000,1,999]		`Slash animation frames (facing east).
dim objAnimSlashW[10000,1,999]		`Slash animation frames (facing west).
dim objAnimShootN[10000,1,999]		`Shoot animation frames (facing north).
dim objAnimShootS[10000,1,999]		`Shoot animation frames (facing south).
dim objAnimShootE[10000,1,999]		`Shoot animation frames (facing east).
dim objAnimShootW[10000,1,999]		`Shoot animation frames (facing west).
dim objAnimDeath[10000,1,999]		`Death animation.
`Temp variables for current map.
dim objSelected[10000]				`Mobile is currently selected.
dim objTransX[10000]				`Temporary X transition to next tile.
dim objTransY[10000]				`Temporary Y transition to next tile.
dim objSpriteHUD[10000]				`Selection sprites attached to mobile (1-25).
dim objDirOld[10000]				`Previous direction of object.
dim objDelay[10000]					`Object delay (negative for script timers).
dim objChecks[10000]				`Passive checks every second (usually for AI).
dim objMobCmd[10000]				`Mobile object's current command.
dim objMobTarg[10000]				`Mobile's current target (use, get, or attack).
dim objMobPathX[10000,5]			`Mobile pathfinding steps, X.
dim objMobPathY[10000,5]			`Mobile pathfinding steps, Y.
dim objEffDie[10000]				`Effect object shrinkage on death (30 frames).

do
    

    Print( ScreenFPS() )
    Sync()
loop

or trust my findings that you are allocating up to ~4GB of RAM doing it this way. it cripples my laptop (and crashes).

Consider sizing arrays dynamically and Type-ing as much of that as possible
Posted: 15th Jul 2023 21:05
Thank you. It is compiling. Unfortunately, it's still not running on Linux, so I guess I need to use types and resize the arrays. Gonna take a long time.
Posted: 15th Jul 2023 21:20
OK, so using the updated array syntax and also lowering max maps from 999 down to 30 got it past the declarations function on Ubuntu, but now it crashes when trying to load music. If I comment out all the music lines, it actually runs with all the images.

I get a window saying, "Error: Could not find file music/intro.ogg" and the file is there.

P.S.: Also, I have to disable the Steam plugin for achievements. Is that normal?

P.P.S.: I'm gonna try just having adjustable array sizes and not using types. Is there any advantage to using types besides OOP-style organization? Does it save more memory than if I just used arrays with adjustable sizes?
Posted: 15th Jul 2023 22:15
Could not find file music/intro.ogg

i believe linux is case-sensitive (while Windows doesn't care). ie:
music/intro.ogg ? Music/Intro.OGG
so, make sure the file path/name cases are correct/match.

dunno about the Steam plugin and don't believe using Typed arrays would affect memory usage but someone else might have actual insight, there. i prefer Types for organizational purposes but if this is a large project you're working on (which i believe it is), i wouldn't consider converting to a Type'd system since you're already familiar with your current structure.

with v2 arrays (again, i never used v1), the ability to sort and search were added (i dunno if you can do this with DIM?). with that, note: only the first variable in a type'd array is used. yes, we can code our own sort and search, swap, .insert/.remove, but they won't be as fast as the built-in system.

there are other reasons i'd get used to v2 arrays including .json functions that may prove a boon to your large-ish inventory project, as well, so up to you if/when you want to look into converting.
Posted: 16th Jul 2023 0:46
Working on the new array system now. But first, is there any way around the case sensitivity in Linux? I have thousands of assets, and I like to keep each word capitalized in the filenames but without spaces. It will take forever to change all the filename cases. I don't wanna have to change everything to lower case because they will be hard for modders to read, but I will if I have to. Thanks.
Posted: 16th Jul 2023 2:08
i could probably knock up a tool that reads a folder's filenames, finds them in source(s) and replaces them with actual filenames. find me on discord to discuss if interested (If you have WIN machine, would make it easier for me since i could use a plugin to help).

otherwise, manual Find/Replace might be your only option.
Posted: 16th Jul 2023 5:49
I'm just gonna make all the resources lower case, but thanks.

For now, how can I adjust array length if it's more than one dimension? For example, I have this declaration: global objName as string[10000,30]

That means there can be 10k objects on one map, and 30 maps max. If you want to make more than 30 maps in the world editor, I need a way to adjust the size with the length command, but I don't know how to do it with more than one dim. Thanks.