Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,416 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
attachen won't work #213082
06/25/08 19:09
06/25/08 19:09
Joined: Feb 2007
Posts: 53
N
n00bie Offline OP
Junior Member
n00bie  Offline OP
Junior Member
N

Joined: Feb 2007
Posts: 53
me again. First some script:

Code:

ENTITY* boosterpaal;
ENTITY* temp_b;
ENTITY* gondel_1;

action rotate_boosterarm()
{
	boosterpaal = me;
	set(my,PASSABLE);
	vec_for_vertex(&temp,my,2691);
...
)

action rotate_gondel1()
{
	gondel_1 = me;
	set(my,PASSABLE);
	vec_for_vertex(&temp_b,boosterpaal,1);
	my.x = temp_b.x;
	my.y = temp_b.y;
	my.z = temp_b.z;
}


The problem is that the engine shuts down with an error. Why? In C-script it worked.

Re: attachen won't work [Re: n00bie] #213084
06/25/08 19:16
06/25/08 19:16
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
action no longer is a supported parameter, replace it with void, that should work.
also, temp is no longer available, you have to define that yourself first.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: attachen won't work [Re: Helghast] #213087
06/25/08 19:27
06/25/08 19:27
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: Helghast
action no longer is a supported parameter, replace it with void, that should work.
also, temp is no longer available, you have to define that yourself first.

regards,


The engine starts now, but the model is'nt visible that should be attached to "boosterpaal". The code:

Code:
VECTOR* temp_b;

ENTITY* boosterpaal;
ENTITY* gondel_1;

void rotate_boosterarm()
{
	boosterpaal = me;
	set(my,PASSABLE);
	vec_for_vertex(&temp_b,my,2691);
...
}


void rotate_gondel1()
{
	gondel_1 = me;
	set(my,PASSABLE);
	vec_for_vertex(&temp_b,boosterpaal,1);
	my.x = &temp_b.x;
	my.y = &temp_b.y;
	my.z = &temp_b.z;
}


Re: attachen won't work [Re: n00bie] #213092
06/25/08 20:27
06/25/08 20:27
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
you dont need to write &temp_b, temp_b.x will do as well.
besides that, looks fine to me.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: attachen won't work [Re: Helghast] #213095
06/25/08 20:48
06/25/08 20:48
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: Helghast
you dont need to write &temp_b, temp_b.x will do as well.
besides that, looks fine to me.

regards,


When I do that, the engine shuts down with a read error.

Re: attachen won't work [Re: n00bie] #213098
06/25/08 21:05
06/25/08 21:05
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Code:
VECTOR* temp_b;

ENTITY* boosterpaal;
ENTITY* gondel_1;

void rotate_boosterarm()
{
	boosterpaal = me;
	set(my,PASSABLE);
	vec_for_vertex(temp_b.x ,my, 2691);
...
}


void rotate_gondel1()
{
	gondel_1 = me;
	set(my,PASSABLE);
	vec_for_vertex(temp_b.x ,boosterpaal,1);
	vec_set(my.x, temp_b.x
}



that doesnt work? it should...


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: attachen won't work [Re: n00bie] #213100
06/25/08 21:11
06/25/08 21:11
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
action is still supported, as well as function. They are just definitions of void. But it can't hurt to replace them, I'd recommend it as well smile.

Since you use a vector pointer instead of a vector, you need to write temp_b->x, temp_b->y etc.

The app crashes because boosterpaal is probably not assigned to rotate_boosterarm yet. You need to let the function wait for the entity to be assigned by writing:
Code:
while(!boosterpaal){wait(1);}

above in the function.


Click and join the 3dgs irc community!
Room: #3dgs
Re: attachen won't work [Re: Joozey] #213103
06/25/08 21:19
06/25/08 21:19
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: Joozey
action is still supported, as well as function. They are just definitions of void. But it can't hurt to replace them, I'd recommend it as well smile.

Since you use a vector pointer instead of a vector, you need to write temp_b->x, temp_b->y etc.

The app crashes because boosterpaal is probably not assigned to rotate_boosterarm yet. You need to let the function wait for the entity to be assigned by writing:
Code:
while(!boosterpaal){wait(1);}

above in the function.


void rotate_boosterarm()
{
boosterpaal = me;

so it is assigned?

And how do you mean with "temp_b->x, temp_b->y"?

Re: attachen won't work [Re: n00bie] #213105
06/25/08 21:36
06/25/08 21:36
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
It is assigned, but perhaps the function rotate_gondel1() is loaded before rotate_boosterarm, thus boosterpaal is still an empty pointer. That's why you need to wait.

-> is used when you ask an object's attribute through a pointer.
Code:
VECTOR vec = nullvector;
VECTOR* vec_pointer;

...
vec_pointer = vec; //give vector reference to the pointer

vec.x = 5;          //vector.x is 5
vec_pointer->x = 6; //and now it is 6



Click and join the 3dgs irc community!
Room: #3dgs

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

Gamestudio download | 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