Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (AndrewAMD, Quad, soulman3, Ayumi), 675 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Entity error, but where? [Re: croman] #232081
10/19/08 10:24
10/19/08 10:24
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
Originally Posted By: cerberi_croman
wait, i didn't understood you now.

1) when you comment this line: if(me == kruiscorrecter1){temp5 = kruisdraaier1;} - does it work or it gives you an error again?

It gives the same error.

Originally Posted By: cerberi_croman

2) when you comment this line: vec_for_vertex(temp,temp5,2);
- does it work or it gives you an error again?


It does work without error, but the entity is not attached to the place where it's belong (the vec_for_vertex script)

Re: Entity error, but where? [Re: n00bie] #232083
10/19/08 10:41
10/19/08 10:41
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
okay we found the problem and the problem is in that function which is obvious. from manual: vec_for_vertex (VECTOR* vector, ENTITY* entity, var number);

do you see what says in first parameter inside of brackets? it says vector and in your code there is entity and that's why you got an error.

you declared temp as ENTITY* temp; which is wrong, you must declare it as a vector: VECTOR temp; and then it will work.

Click to reveal..

VECTOR temp;
ENTITY* temp1;
ENTITY* temp2;
ENTITY* temp3;
ENTITY* temp4;
ENTITY* temp5 [4];

#define draaien skill1
#define draaien2 skill2
...

action act_kruis1()
{
kruis1 = me;
while(my)
{
wait(1);
if(me == kruis1){temp1 = vloer;}
vec_for_vertex(temp,temp1,340);

my.pan += my.draaien2 + vloer.draaien;
if(key_w == 1)
{
if(my.draaien2 > -2.5 - vloer.draaien)
{
my.draaien2 -= 0.04*time_step;
}
}
if(my.draaien2 < 0 && vloer.draaien > 0)
{
if(my.draaien2 < -2.5 - vloer.draaien)
{
my.draaien2 += 0.018*time_step;
}
}
if(key_s == 1)
{
if(my.draaien2 < 0)
{
my.draaien2 += 0.04*time_step;
}
}
my.roll = -kruiscorrecter1.y;
my.tilt = kruiscorrecter1.x;
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
wait(1);
}
}

action act_kruiscorrecter1()
{
kruiscorrecter1 = me;
while(my)
{
wait(1);
if(me == kruiscorrecter1){temp5 = kruisdraaier1;}
vec_for_vertex(temp,temp5,2);
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
wait(1);
}
}

action act_kruisdraaier1()
{
while(my)
{
wait(1);
my.pan += my.draaien2 + vloer.draaien - my.draaien;
if(key_w == 1)
{
if(my.draaien2 > -2.5 - vloer.draaien)
{
my.draaien2 -= 0.04*time_step;
}
}
if(my.draaien2 < 0 && vloer.draaien > 0)
{
if(my.draaien2 < -2.5 - vloer.draaien)
{
my.draaien2 += 0.018*time_step;
}
}
if(key_s == 1)
{
if(my.draaien2 < 0)
{
my.draaien2 += 0.04*time_step;
}
}
wait(1);
}
}




and if this dont work then use this

Click to reveal..

ENTITY* temp [11];
ENTITY* temp1;
ENTITY* temp2;
ENTITY* temp3;
ENTITY* temp4;
ENTITY* temp5 [4];

VECTOR temper; // new

#define draaien skill1
#define draaien2 skill2
...

action act_kruis1()
{
kruis1 = me;
while(my)
{
wait(1);
if(me == kruis1){temp1 = vloer;}
vec_for_vertex(temp,temp1,340);

my.pan += my.draaien2 + vloer.draaien;
if(key_w == 1)
{
if(my.draaien2 > -2.5 - vloer.draaien)
{
my.draaien2 -= 0.04*time_step;
}
}
if(my.draaien2 < 0 && vloer.draaien > 0)
{
if(my.draaien2 < -2.5 - vloer.draaien)
{
my.draaien2 += 0.018*time_step;
}
}
if(key_s == 1)
{
if(my.draaien2 < 0)
{
my.draaien2 += 0.04*time_step;
}
}
my.roll = -kruiscorrecter1.y;
my.tilt = kruiscorrecter1.x;
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
wait(1);
}
}

action act_kruiscorrecter1()
{
kruiscorrecter1 = me;
while(my)
{
wait(1);
if(me == kruiscorrecter1){temp5 = kruisdraaier1;}
vec_for_vertex(temper,temp5,2);
my.x = temper.x;
my.y = temper.y;
my.z = temper.z;
wait(1);
}
}

action act_kruisdraaier1()
{
while(my)
{
wait(1);
my.pan += my.draaien2 + vloer.draaien - my.draaien;
if(key_w == 1)
{
if(my.draaien2 > -2.5 - vloer.draaien)
{
my.draaien2 -= 0.04*time_step;
}
}
if(my.draaien2 < 0 && vloer.draaien > 0)
{
if(my.draaien2 < -2.5 - vloer.draaien)
{
my.draaien2 += 0.018*time_step;
}
}
if(key_s == 1)
{
if(my.draaien2 < 0)
{
my.draaien2 += 0.04*time_step;
}
}
wait(1);
}
}





Ubi bene, ibi Patria.
Re: Entity error, but where? [Re: croman] #232085
10/19/08 10:49
10/19/08 10:49
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
EDIT: with both solutions it gives still the same error.

Last edited by n00bie; 10/19/08 10:51.
Re: Entity error, but where? [Re: n00bie] #232086
10/19/08 10:51
10/19/08 10:51
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
then something is wrong with your temp1-5 entities. why have you declared ENTITY* temp[11] like this?



Ubi bene, ibi Patria.
Re: Entity error, but where? [Re: croman] #232087
10/19/08 10:53
10/19/08 10:53
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
Originally Posted By: cerberi_croman
then something is wrong with your temp1-5 entities. why have you declared ENTITY* temp[11] like this?


Because different script files uses the temp entity. And only the movements script uses temp1-5.

Re: Entity error, but where? [Re: n00bie] #232088
10/19/08 10:56
10/19/08 10:56
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
i'm sorry but i dont see where the problem is. try commenting line by line to find where are the errors and then...i dont know, try to fix that somehow because i really dont see a solution, sorry.



Ubi bene, ibi Patria.
Page 2 of 2 1 2

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