gra
|
 |
Posted on: March 07, 2013, 02:36:45 pm |
|
|
 Joined: Feb 2013
Posts: 147
|
how can do this? i have try with clipboard_get_string at start for give path variable and save game , but not is good becouse: 1 the function not go 2 not is professional  ok i have environment_get_variable, in linux this can be used? and i can set a enviroment variable at start of game? i try with open ini to save variable of dir , but not go 
|
|
|
|
« Last Edit: March 08, 2013, 10:33:06 am by gra »
|
Logged
|
|
|
|
polygone
|
 |
Reply #1 Posted on: March 07, 2013, 04:08:29 pm |
|
|
 Location: England Joined: Mar 2009
Posts: 794
|
Try working_directory + "\file"
|
|
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
|
|
|
|
|
gra
|
 |
Reply #5 Posted on: March 08, 2013, 01:14:27 am |
|
|
 Joined: Feb 2013
Posts: 147
|
2. Some time ago paths were hardcoded to the compile dir. So it ended up being static. Currently this should be fixed and compiled games should show working directory. anyway working_directory have another problem under linux becouse, in linux is /file/path/ working directory write \file\path but the real problem is how store in variable the actual position of game folder? i have see get_working_directory but not go environment_get_variable can be used ?? if yes in linux this not go environment_get_variable("0")my brother say that 0 release the path if game executable in linux enviroment variables
|
|
|
|
« Last Edit: March 08, 2013, 05:39:23 am by gra »
|
Logged
|
|
|
|
gra
|
 |
Reply #6 Posted on: March 08, 2013, 10:32:00 am |
|
|
 Joined: Feb 2013
Posts: 147
|
great news i have solved with c++ getenv("HOME") wuuuwuuu lets go with external resource
|
|
|
|
|
Logged
|
|
|
|
gra
|
 |
Reply #7 Posted on: March 27, 2013, 02:20:50 am |
|
|
 Joined: Feb 2013
Posts: 147
|
in a script that execute a bash script i have found this cd ${0%/*} this load in a folder of script , i have write getenv("{0%/*}") but not go ,any idea (for load in a folder of program)?
|
|
|
|
|
Logged
|
|
|
|
|
|
gra
|
 |
Reply #9 Posted on: March 29, 2013, 02:00:38 am |
|
|
 Joined: Feb 2013
Posts: 147
|
not work , string_find not is know by enigma EDIT good i have find getenv("PWD")this give a directory of executed bash script, for this fact: GOOD -this environment variable give full path of folders in linux NOT GOOD -this can't be view directly by enigma becouse the environment variable give a folder of enigma, for view, place the file of game in folder and execute EDIT2 under windows the variable is CD,but i don'know why the program not start , wine problem or other i try under windows if i switch  getenv("CD")for the explanation linux PWD print working directory windows CD current directory
|
|
|
|
« Last Edit: March 29, 2013, 03:10:45 am by gra »
|
Logged
|
|
|
|
polygone
|
 |
Reply #10 Posted on: March 29, 2013, 11:27:02 am |
|
|
 Location: England Joined: Mar 2009
Posts: 794
|
Hmm, maybe we should write a function in enigma to help with this.
file_in_game_directory(string filename) It's not something I can write just myself through as I can't test cross-platform.
|
|
|
|
« Last Edit: March 29, 2013, 04:28:23 pm by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
gra
|
 |
Reply #11 Posted on: March 29, 2013, 12:53:42 pm |
|
|
 Joined: Feb 2013
Posts: 147
|
Hmm, maybe we should write a function in enigma to help with this. good idea, but the path is different in two system, for example working_directoryhave only the windows path (\with\this\bars) and is static in relation to compiled file  The windows CD environment variable not go, anyway  EDIT linux path have different bar /
|
|
|
|
|
Logged
|
|
|
|
|