Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,397 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
E1513: crash in def_console #237862
11/23/08 00:42
11/23/08 00:42
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Hello All.

I have a problem with local variables, it appears. I encountered it while programming a level, and have narrowed the problem to the following very small piece of code. This is my script (in lite-C):

----------------------------------------------
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

function main()
{
video_switch(7,0,1);
wait(3);
level_load("probleme2.WMB");
wait(2);
}


action a_object()
{
VECTOR* distance = {x=0;y=0;z=0;}
}
-------------------------------------------------

Whenever I attach this script to a level (even if it does not contain an entity), and I press "tab" to see the console, the message "Error 1513: Crash in def_console" appears instead. And if I add other pieces of code afterwards, then it does funny stuff or does not work at all.

Does anybody have a clue what is wrong here? I'm sure it's very obvious, but I have no clue what it is is. Aren't we allowed to define vectors as local variables?

Thanks a lot for any help.

Thomas

PS: I am using A7.5 Pro running on Athlon dual core, WinXP Pro, and 1 Gig of RAM.

Re: E1513: crash in def_console [Re: ngisiger] #238257
11/25/08 23:35
11/25/08 23:35
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Why are you defining a vector inside the Action?
VECTOR* distance = {x=0;y=0;z=0;}

Did you try placing this line outside the Action?

Ottawa smile

Re: E1513: crash in def_console [Re: Ottawa] #238266
11/26/08 00:28
11/26/08 00:28
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Originally Posted By: Ottawa
Hi!

Why are you defining a vector inside the Action?
VECTOR* distance = {x=0;y=0;z=0;}

Did you try placing this line outside the Action?

Ottawa smile


local vectors are legal.


@ngisiger: Are you sure you need a vector pointer? Try removing the star.


Last edited by heinekenbottle; 11/26/08 00:29.

I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: E1513: crash in def_console [Re: heinekenbottle] #238394
11/27/08 00:30
11/27/08 00:30
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Hello Ottawa and Heinekenbottle.

Thank you very much for both your replies.

@Ottawa: you're right - when I place the exact same definition outside the action, then it works perfectly. That's what I ended up doing (although I like using local variables to make my actions more portable).

@Heinekenbottle: you're right also - if I remove the "*" as you suggest, then the local vector definition seems to work.

I'll admit to being a bit confused as to how we are supposed to define vectors in lite-C:

VECTOR v = {x=0;y=0;z=0;}

or

VECTOR* v = {x=0;y=0;z=0;}

It seems one works for local variables, and the other for global variables. I find the manual could be a little clearer on that point.

Thanks again!

Thomas

Re: E1513: crash in def_console [Re: ngisiger] #238520
11/28/08 00:52
11/28/08 00:52
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi! smile

I've looked at the manual and found the answer
to this situation under

beginner's mistakes

Mistake 4: Using pointers the wrong way

Good reading smile

Ottawa

Re: E1513: crash in def_console [Re: Ottawa] #239698
12/06/08 16:34
12/06/08 16:34
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Hi again.

Thanks! That Figures (I AM a beginner in lite-C). smile

Despite my beginner difficulties, I already find lite-C a HUGE improvement over wdl. I am working on scripts which move around a large number of entities. In wdl, we had to use handles for pointers to access entities. I was simply getting lost in the code.

Now, I simply create structures such as the following

typedef struc{
var x;
var y;
var z;
var pan;
var tilt;
var roll;
ENTITY* ent;
} bit

bit stuff[100];

With this, accessing, moving and orienting whole sets of entities is completely straightfoward.

Thanks again, Ottawa (I guess I should call myself Montreal - that's where I live) laugh

Thomas

Re: E1513: crash in def_console [Re: ngisiger] #239886
12/08/08 00:14
12/08/08 00:14
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi Tomas! smile

It just happened that the information was in that section.

We all have our troubles accesing and learning new things.

Salut de Michel smile


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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