Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / CreateVector3() in Tier 2 causes exception error.

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 30th Nov 2017 00:00
When I declare the vector, Visual Studio throws an exception error.

int vector_dest = agk::CreateVector3();


also tried


int vector_dest = agk::CreateVector3(0.0f, 0.0f, 0.0f);


Documentation says it needs to be declared as a regular integer, however Visual states it needs to be declared as a static integer. Tried both. Commenting out the vector declaration eliminates the crashes.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 30th Nov 2017 06:08
Hello Tobias,
kinda scary, it should work like you say.

Where do you declare it?
If you declare an int in init(), it wont appear in the loop().

Do you have tried it to declare the integer of the vector in the header file?


[/url]
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 30th Nov 2017 14:02 Edited at: 30th Nov 2017 14:24
I'm declaring all variables before the
void app::Begin(void)



I have too tried to declare the variable before using the agk:: function to create a vector.
Quote: "
//int vect_player;
//int vector_dest;

//vect_player = agk::CreateVector3();
//vector_dest = agk::CreateVector3();
"


As far as I can tell, when I comment this stuff out, the error goes away.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Nov 2017 23:05
I think I know what you are doing wrong.
If you are calling this line before app::Begin(void) it will not work.



agk::CreateVector3() creates an ID using a hash list that does not get initialized until after app::Begin(void) is called.

You can declare the variable before app::Begin(void) but fill in begin or in the loop.

The coffee is lovely dark and deep,and I have code to write before I sleep.
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 2nd Dec 2017 00:26
Quote: "If you are calling this line before app::Begin(void) it will not work."


Ah, I see. I'll have to check this out. Thank you.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net

Login to post a reply

Server time is: 2024-09-30 11:41:24
Your offset time is: 2024-09-30 11:41:24