PDA

View Full Version : Help ?


The Horny Rat
2003-12-28, 07:41 PM
This is strange, my shotgun onfire function is making what ever projectile I use not be reloaded after the game goes to the next map...
The gun works the first time you play the game but after the map changes the projectile is not loaded..

I was thinking it was my shotguns projectile, so I changed it so it used the one for my minigun, located in a diffrent weapon file, same thing the shotgun and the minigun worked first map, but next map they both had no projectile...
so what ever projectile I make my shotgun onfire function call, gets not loaded after mission change, I even tested one more type same thing...
This blows my mind, this never happend coding tribes2!!!!

Plus I still can't get my beam projectile types to have explosions, and the death message stoped working correct after the last update...




// -----------------------------------------------------------------------------
// -- onFire Functions
// -----------------------------------------------------------------------------

function ShotgunImage::onFire( %data, %obj, %slot )
{
%obj.decInventory( %data.ammo, 1 );
%obj.applyKick(-150);
// ----
%projectile = "SGunProj";
// ----

// -- required for projectiles which inherit velocity from their parent
%muzzleVelocity = VectorAdd(
VectorScale(%obj.getMuzzleVector(%slot), %projectile.muzzleVelocity),
VectorScale(%obj.getVelocity(), %projectile.velInheritFactor));

// -- if there's a projectile variance, apply it
%TwoPi = 2 * 3.1415926;
%Spread = %TwoPi * %Data.projectileSpread;
%ProjectileCount = %Data.projectileCount;

%Count = 1;
while (%Count <= %ProjectileCount)
{
%VectorX = (getRandom() - 0.5) * %Spread;
%VectorY = (getRandom() - 0.5) * %Spread;
%VectorZ = (getRandom() - 0.5) * %Spread;
%Matrix = MatrixCreateFromEuler(%VectorX @ " " @ %VectorY @ " " @ %VectorZ);
%muzzleVelocity = MatrixMulVector( %matrix, %muzzleVelocity );


%p = new BulletProjectile()
{
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%projectile);
%Count++;
}
}

NoFiX
2003-12-29, 01:38 PM
I can see a few issues with the code, other than this, but I believe this is your problem.


%p = new BulletProjectile()
{
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%projectile);


Do you see the problem? It's killing your projectile datablock on mission cleanup.

replace this line MissionCleanup.add(%projectile);
with this line MissionCleanup.add(%p);

And that should solve your problem.

The Horny Rat
2003-12-29, 06:03 PM
Thanks,

That worked, I was using some spread code from tribes2 and left that in..
None of my weapons besides this shotgun ever used MissionCleanup.add(%projectile); its always been MissionCleanup.add(%p);
I did not think it made realy much difference....


Do you know how to run a mod folder in Legends?
I tried just putting my modified scripts in the Legends as a Mod_scripts.unf, hoping it would get loaded after the base scripts, it worked in part but not all my stuff got loaded right...


Right now I am replacing the base scripts with my modified scripts.unf

The Horny Rat
2003-12-29, 09:30 PM
Lol
:P :blink: :lol: :o :D :huh: ;) :) :unsure:
That cracked me Up, You just made my day!
I think I will order some canadian bacon on my pizza next time! :P
gota help keep you guys employed up there...

MrSniper
2003-12-29, 10:39 PM
Canadian's post has been removed due to its superfulity. Should he post in that manner again, further action will be taken against him. This is a forum for the discussion of Legends, not for calling names and insulting people who are working very hard to add quality content to this game -- be they Dev team members or community members.

canadian
2003-12-30, 07:27 AM
Originally posted by MrSniper@Dec 29 2003, 05:39 PM
Canadian's post has been removed due to its superfulity. Should he post in that manner again, further action will be taken against him. This is a forum for the discussion of Legends, not for calling names and insulting people who are working very hard to add quality content to this game -- be they Dev team members or community members.
too bad you are wrong and a 17 year old.
You do NOT know defender.. you cannot pass judgement on the matter. He 'makes' nothing..

The Horny Rat
2003-12-30, 08:25 AM
Canadian,
just stop with it all..............
He gave me his source codes way back in 2001, then later told every one I stole it to discredit me. so hes not some good guy if thats what you think he is, I have all his old post from the T2cc, way back when he admited he did give me the source codes, and he told every one he had been Lieing about it before, and a lot people know this fact...

If I had stole his original works, your first point accussing me of stealing or what ever would be valid...

I do give credit to him in the war2003 readme in the tribes2 mod...

It takes a lot of work to make mods no matter if some of the code is not all made by the guy making the mod...
DynaBlade had like 3 people helping him make md2, I had no one, and my mod using some of his codes he gave, did better than his mod, give me a little credit here because its do....


The only code I am using in my Legends mod of his, is some of the the Mitzi cannon code and his EMP Burn, and kickback functions...

In Legends I had to recode or mod every thing in there my self its not the same as tribes2, I know none of its realy advanced, but never the less I deserve some credit for the work...

MrSniper
2003-12-30, 03:22 PM
I am not passing judgement, I am simply reminding everyone of the purpose of this board, which dictates the manner in which it is moderated.

For example, this thread had the express purpose of solving a projectile loss issue on map change. This issue has been resolved, therefor this thread has served its purpose and may now be closed.