Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (AndrewAMD, fogman, Grant, juanex), 972 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
weird function error #240718
12/12/08 02:41
12/12/08 02:41
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
just a quick question.
when i run the following function:

[code]
function movechar()
{
if(player != NULL)
{
posidon.x = mouse_pos.x;
posidon.y = mouse_pos.y;
posidon.z = 0;
vec_for_screen(posidon,camera);
posidon.x += camera.x;
posidon.y += camera.y;
vec_set(player,posidon);
}
}
[code\]


quick description:
(posidon vector has been predefined)
if the player pointer has been set to an entity,
it sets the mouse coordinates to the posidon vector.
it then turns this into world coordinates and adds the camera position. it then moves the player to this position, e.g
(this function is triggered by a mouse click)
you click somewhere, and the player goes there
note that the camera is already looking down the z axis.

now, the problem is that when the containing script compiles, i get the error "'x': is not a member of 'function'" on the first posidon line. i have no idea what this means, as posidon is a variable, not a function.
the definition of posidon follows:
var posidon = vector(0,0,0);

any help is greatly appreciated,

Re: weird function error [Re: the_mehmaster] #240719
12/12/08 03:08
12/12/08 03:08
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
ok i fixed it mostly. sorry for any inconvenience

Re: weird function error [Re: the_mehmaster] #240782
12/12/08 14:57
12/12/08 14:57
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Your function code should be using posidon[0], posidon[1], and posidon[2] instead of posidon.x, .y, and .z
Unless you replace its global definition as
VECTOR* posidon = { x=0, y=0; z=0; }
instead of
var posidon = vector(0,0,0);
Using the var version may cause odd problems later if you use the vector(x,y,z) function
too often.

Using the VECTOR* posidon = { x=0, y=0; z=0; } and leave the rest of your code as is would
be my preferred option.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: weird function error [Re: EvilSOB] #240851
12/12/08 22:18
12/12/08 22:18
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline OP
User
the_mehmaster  Offline OP
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
hey thanks, that fixed the other part

Re: weird function error [Re: the_mehmaster] #240892
12/13/08 08:23
12/13/08 08:23
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Anytime.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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