Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 1,173 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
2 questions. #382491
09/08/11 19:09
09/08/11 19:09
Joined: Sep 2011
Posts: 11
X
Xyro Offline OP
Newbie
Xyro  Offline OP
Newbie
X

Joined: Sep 2011
Posts: 11
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 ?

Re: 2 questions. [Re: Xyro] #382493
09/08/11 19:16
09/08/11 19:16
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
you missed a semi-colong, it should be:

mainCharacter = me;

Re: 2 questions. [Re: darkinferno] #382496
09/08/11 19:20
09/08/11 19:20
Joined: Sep 2011
Posts: 11
X
Xyro Offline OP
Newbie
Xyro  Offline OP
Newbie
X

Joined: Sep 2011
Posts: 11
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

Re: 2 questions. [Re: Xyro] #382497
09/08/11 19:25
09/08/11 19:25
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Maybe a pointer, address problem at a string...
IMHO

Re: 2 questions. [Re: Aku_Aku] #382498
09/08/11 19:27
09/08/11 19:27
Joined: Sep 2011
Posts: 11
X
Xyro Offline OP
Newbie
Xyro  Offline OP
Newbie
X

Joined: Sep 2011
Posts: 11
Sorry, is this a solution or are you just thinking out loud xD?

Re: 2 questions. [Re: Xyro] #382501
09/08/11 19:44
09/08/11 19:44
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
try to access the mainCharacter it says : Script crash in main SYS but other then that it runs fine

Show the code where you access that pointer.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: 2 questions. [Re: Xyro] #382503
09/08/11 19:59
09/08/11 19:59
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
That was a solution based on my telepaty device, because i had to remotely decrypt your code.

Re: 2 questions. [Re: Aku_Aku] #382507
09/08/11 20:43
09/08/11 20:43
Joined: Oct 2009
Posts: 149
Germany
M
muffel Offline
Member
muffel  Offline
Member
M

Joined: Oct 2009
Posts: 149
Germany
I believe the problem is here
Quote:

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:

Found under Script Programming -> Functions

So name the action diffrent

muffel


Last edited by muffel; 09/08/11 20:45.
Re: 2 questions. [Re: muffel] #382515
09/08/11 21:53
09/08/11 21:53
Joined: Sep 2011
Posts: 11
X
Xyro Offline OP
Newbie
Xyro  Offline OP
Newbie
X

Joined: Sep 2011
Posts: 11
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

Last edited by Xyro; 09/08/11 21:54.
Re: 2 questions. [Re: Xyro] #382518
09/08/11 22:19
09/08/11 22:19
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
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

Check out my new game: Pogostuck: Rage With Your Friends
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1