Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_for_vertex problem #271512
06/13/09 16:19
06/13/09 16:19
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Hello everybody,

I have a tricky problem. I have the following script:

Code:
entity* zug;

action pp_bol {
   var zz;
   zz = my.z;
   zug = my;
   
   while(1) {
      my.z = zz+9.6-hubring*-14-10;
      my.pan = molen.pan+100;     
      my.tilt = 26*hubring*sin(exzenter_pos+molen.pan);
      my.roll = 26*hubring*cos(exzenter_pos+molen.pan); 
            
      wait(1);
   }
}

function stange1() {
	var zpos1[3];
	var zpos2[3];
   vec_set(my.scale_x,vector(1.200,0.800,0.800));
proc_late();
   
   while(1) {
      
      vec_for_vertex(my.x,you,87);
      vec_for_vertex(zpos2.x,you,87);
      
      vec_for_vertex(zpos1.x,zug,41);
      vec_for_vertex(zpos2.x,zug,41);
      
      vec_lerp(temp.x,zpos1.x,zpos2.x,0.0);
      vec_diff(temp.x,temp.x,my.x);
      vec_to_angle(my.pan,temp.x);
      
      wait(1);
   }
}


But when I am going to test the programm I got the following error:

Error E1515: Invalid arguments in stange1: vec_for_vertex(zpos1.x,zug,41)
Error E1515: Invalid arguments in stange1: vec_for_vertex(zpos2.x,zug,41)

I don't know what the problem is, and I can't find the problem.

I hope you can help me.

Thanks in advance.

Greetings,

Polypfreak1987.

Re: vec_for_vertex problem [Re: Polypfreak1987] #271571
06/13/09 23:40
06/13/09 23:40
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
possibly the while loop is running before ZUG get filled, or after ZUG is destroyed.
Try this
Code:
   while(1) 
   {
      if((me!=0)&&(you!=0)&&(zug!=0)) 
      {
         vec_for_vertex(my.x,you,87);
         vec_for_vertex(zpos2.x,you,87);
      
         vec_for_vertex(zpos1.x,zug,41);
         vec_for_vertex(zpos2.x,zug,41);
      
         vec_lerp(temp.x,zpos1.x,zpos2.x,0.0);
         vec_diff(temp.x,temp.x,my.x);
         vec_to_angle(my.pan,temp.x);
      }
      wait(1);
   }



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: vec_for_vertex problem [Re: EvilSOB] #271602
06/14/09 06:06
06/14/09 06:06
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Thank you, that did the trick. smile

Re: vec_for_vertex problem [Re: Polypfreak1987] #271604
06/14/09 06:19
06/14/09 06:19
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

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