Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → I do NOT get vectors.
I do NOT get vectors.
2004-12-11, 12:09 PM #1
AT ALL. AAAARGH.

Not a single one of my cogs using vectors works properly.

Example:
Code:
user1:
  rain_chn=PlaySoundLocal(rain_snd, 0.7, 0, 0x1);
  numSurfs = GetSurfaceCount();
  for(x = 0; x < numSurfs; x = x + 1){
    if(GetSurfaceMat(i) == rainmat) {
	SetFaceGeoMode(x, 4);
	rainfall=SlideSurface(x, rainvec, 1.5);
    }
  }
return;


This should slide all surfaces with the rainmat downward (vector rainvec is defined in JED as '(0/0/-1)') and even if that's wrong it should slide them somewhere!

Code:
user0:
if(on==0) {
on=1;
for(i=0; i<7; i=i+2) tree0=CreateThingAtPos(tree, tsec, tpos0, '0 0 0');
for(i=1; i<7; i=i+2) tree0=CreateThingAtPos(tree, tsec, tpos0, '0 180 0');
}
return;


tpos0-6 are all vectors with values in JED like (2.1/-16.825/2.275).

WHY DO NONE OF THESE WORK?!
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-12-11, 12:18 PM #2
[edit] obviously I edited just as Grismath posted below -- I asked why he was incrementing the loops by 2; I didn't see that one of them was for(x=0;...) and the other was for(x=1;...)[/edit]

I see no reason they shouldn't work... hmm..
May the mass times acceleration be with you.
2004-12-11, 12:20 PM #3
Yes I do. That's why I have 2 for loops, one handles evens (starting at 0, then +2), and the other handles odds (starting at 1, then +2).
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-12-11, 2:25 PM #4
Code:
user1:
  rain_chn=PlaySoundLocal(rain_snd, 0.7, 0, 0x1);
  numSurfs = GetSurfaceCount();
  for(x = 0; x < numSurfs; x = x + 1){
    if(GetSurfaceMat(i) == rainmat) {
	SetFaceGeoMode(x, 4);
	rainfall=SlideSurface(x, rainvec, 1.5);
    }
  }
return;

...Thats busted...

Code:
user1:
  rain_chn=PlaySoundLocal(rain_snd, 0.7, 0, 0x1);
  numSurfs = GetSurfaceCount();
  for(x = 0; x < numSurfs; x = x + 1){
    if(GetSurfaceMat(x) == rainmat) {
	SetFaceGeoMode(x, 4);
	rainfall=SlideSurface(x, rainvec, 1.5);
    }
  }
return;


That should work. The variable in "GetSurfaceMat()" was wrong. As for the other one . . . is your template right?
And when the moment is right, I'm gonna fly a kite.
2004-12-11, 9:34 PM #5
ohhhh ho ho... wow. Sleep helps. Thanks, geeb.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!