Page 1 of 1

Respawn

PostPosted: Wed Mar 30, 05 5:37 am
by Trailmix
How do make it so the regular weps (assaultrifle, shotgun, sniper..etc.) don't respawn in MP?

PostPosted: Wed Mar 30, 05 7:12 am
by clyzm
There's a setting in the weapon's properties (weaponai if i remember) that says "WeaponRespawn" set it to true or something ...

PostPosted: Wed Mar 30, 05 7:25 am
by Trailmix
Well that's extended in DeusExWeapon, but that's only for DXSP i think.

PostPosted: Wed Mar 30, 05 7:32 am
by clyzm
Dunno ...

try looking at the properties of DXMP weapons like LAWS and lams

PostPosted: Wed Mar 30, 05 12:22 pm
by AlexDenton
im afraid its impossible

its built into the MP engine for the weapons to automatically re-spawn after a certain amount of time, and the mapper only has control over the amount of time it takes for those weapons to re-spawn

ie- the weapon rack respawns as soon as the weapon is picked up

things like Meds take 30 seconds etc

PostPosted: Wed Mar 30, 05 12:56 pm
by Dae
Add destroy() in the end of the frob() function. That's all :lol:

PostPosted: Wed Mar 30, 05 2:40 pm
by AlexDenton
does that bypass the MP engine's automatic command to re-spawn items?

PostPosted: Wed Mar 30, 05 4:41 pm
by Dae
Destroy() destroys the class. If theres no class, theres nothing to respawn.

PostPosted: Wed Mar 30, 05 5:12 pm
by Flip
But say if there is 3 assault rifles, won't that destroy them all, if only one is picked up?

PostPosted: Wed Mar 30, 05 7:01 pm
by Trailmix
Yes that kind of defeats the purpose of what I am asking.

Well, I have been thinking, instead of having party-map shops run by people, and having abuse of it when no admin is present. That weapon vending machines be placed instead. The coding for that is already done, but when I tested it, the weapons didn't go away.

That way also has more security.

PostPosted: Wed Mar 30, 05 7:06 pm
by AlexDenton
edit the engine :D

PostPosted: Wed Mar 30, 05 7:59 pm
by Dae
Ray wrote:Yes that kind of defeats the purpose of what I am asking.

Well, I have been thinking, instead of having party-map shops run by people, and having abuse of it when no admin is present. That weapon vending machines be placed instead. The coding for that is already done, but when I tested it, the weapons didn't go away.

That way also has more security.

Was that hard to you to tell this in the first post ? It's simple to do. :) But it has numerous solutions.
There is one, that looks like:
ItemFromMachine.LifeSpan = 10;
- add in properties of spawned item.

For example, i'll take a part of the code from VendingMachine class (DeusEx.u)

if (product != None)
{
if (product.IsA('Sodacan'))
PlaySound(sound'VendingCan', SLOT_None);
else
PlaySound(sound'VendingSmokes', SLOT_None);
product.Velocity = Vector(Rotation) * 100;
product.bFixedRotationDir = True;
product.RotationRate.Pitch = (32768 - Rand(65536)) * 4.0;
product.RotationRate.Yaw = (32768 - Rand(65536)) * 4.0;
<b>product.LifeSpan = 10;</b> // now, it will disappear in some time
}


Marco goddamnit, if you learned a word 'engine' theres no need to say it in every posting!! 8)

PostPosted: Wed Mar 30, 05 8:13 pm
by clyzm
Or, you could build a WeaponRespawn class in a different mod, sort of the code that goes like this *following respawn.uc*

WeaponRespawn extends Respawn

/ / This is what we do to spawn the items.
Frob() destroy()


and so forth ... like this

/ / We respawn only THESE actors
.WeaponRifle
.WeaponAssaultGun


et cetera, et cetera ... and then add this little line

/ / Now, we should add this property for spawning to make easier
Property.'SpawnClass'
extends respawn

and then, it would generate something like in the properties of a respawner class

"SpawnClass" and you can choose the weapons you wanted to respawn in the code et cetera

I'm not really into UED code, and this is just a memory i had once .. so it has a lot of problems in there ... don't blame me for 'em.

PostPosted: Wed Mar 30, 05 8:21 pm
by Trailmix
Ok thanks guys. :)

PostPosted: Wed Mar 30, 05 8:28 pm
by Trailmix
Ok thanks everyone. It works now. :)