I saw a post about this awhile ago, but it looks like it got pruned...
Anyway, what I remember from it was the pulse message, it was something like
From that I have made this cog.
But It doesn't work. When I tested it, after the raildet was fired, the player started moving at different speeds and in random directions. Any ideas on how to make it work right? (Oh yeah, it's a class cog for the raildet.)
------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
Anyway, what I remember from it was the pulse message, it was something like
Code:
pulse: victim = FirstThinginView(player, 50, 10, 0x4FE); curvel = VectorScale(GetThingLVec(rail), 2.7); SetThingLook(rail, VectorSub(GetThingPos(victim), GetThingPos(rail))); lookvel = VectorScale(GetThingLVec(rail), 2.0); seekvel = VectorAdd(curvel, lookvel); SetThingVel(rocket, seekvel);
From that I have made this cog.
Code:
symbols thing player local thing rail local thing victim local vector curvel local vector lookvel local vector seekvel local message created message pulse end # ======================================================================================== code created: SetPulse(.5); return; # ======================================================================================== pulse: player = GetSenderRef(); rail = GetSourceRef(); victim = FirstThinginView(player, 50, 10, 0x4FE); curvel = VectorScale(GetThingLVec(rail), 2.7); SetThingLook(rail, VectorSub(GetThingPos(victim), GetThingPos(rail))); lookvel = VectorScale(GetThingLVec(rail), 2.0); seekvel = VectorAdd(curvel, lookvel); SetThingVel(rail, seekvel); return;
But It doesn't work. When I tested it, after the raildet was fired, the player started moving at different speeds and in random directions. Any ideas on how to make it work right? (Oh yeah, it's a class cog for the raildet.)
------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"