Hello I would like to know on how to get the position of a position object placed in the level editor.
And seccond, I have a model placed in the level editor and I want to use that model in my code so I gave it a action called startup which I defined in my main.c :
ENTITY* mainCharacter;
action startup() { mainCharacter = me }
but that didn't work out so great. So what is the correct way of doing this ?
Sorry thats just a copy paste error, I had that but whenever I start the game and try to access the mainCharacter it says : Script crash in main SYS but other then that it runs fine
Functions ending with ..._startup are executed right after the main() function, and LC before the engine and video device is initialized. This way, every script can have its own startup function which initializes its variables or objects. Example:
Well sorry, I didn't think that it was necessary to provide the other code since I thought it had something to do with me just doing it all wrong but here is the full document : http://pastebin.com/CyNGkFYD
I also changed startup to characterStartup and it still does the same
Place while(!mainCharacter) wait(1); in line 28 before the first physX instruction. Even though the entities are loaded already, their actions will be run after your first wait(1) in the main function, thus the pointer is invalid when you try to access it.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual