But seems doesn't work isn't actually possible to change this settings in game without change the weapon class directly?function bool CheckReplacement(Actor Other, out byte bSuperRelevant){
if (Other.IsA('ShockRifle')){
ShockRifle(Other).DeathMessage="%k electrified %o with the Combo %w.";
ShockRifle(Other).PickupMessage="You got the enhanced Combo Shock Rifle.";
ShockRifle(Other).ItemName="Enhanced Combo Shock Rifle";
ShockRifle(Other).PlayerViewMesh=LodMesh'Botpack.sshockm';
ShockRifle(Other).ThirdPersonMesh=LodMesh'Botpack.SASMD2hand';
return true;
}
}
Change weapon settings in game?
-
iloveut99
- Skilled
- Posts: 231
- Joined: Mon Aug 16, 2010 10:25 pm
Change weapon settings in game?
I have this:
-
Rakiayn
- Masterful
- Posts: 550
- Joined: Fri Aug 28, 2009 3:33 pm
Re: Change weapon settings in game?
If a player picksup a weapon, a new weapon is spawned and gived directly to the player. however, this new weapon has the default properties
you would have to change to weapons code so this properties are given to the new weapon.
perhaps there is a more easy way. isnt there a function in the mutator class that allows picked up inventory to be changed?
correct me if im wrong
you would have to change to weapons code so this properties are given to the new weapon.
perhaps there is a more easy way. isnt there a function in the mutator class that allows picked up inventory to be changed?
correct me if im wrong
-
iloveut99
- Skilled
- Posts: 231
- Joined: Mon Aug 16, 2010 10:25 pm
Re: Change weapon settings in game?
I have tried this:
Don't work either, so I believe I can only edit that in the weapon classes. If anyone know another way please tell.function Tick(float DeltaTime){
local ShockRifle aux;
foreach Level.AllActors(Class'ShockRifle',aux){
aux.DeathMessage="%k electrified %o with the Combo %w.";
aux.PickupMessage="You got the enhanced Combo Shock Rifle.";
aux.ItemName="Enhanced Combo Shock Rifle";
aux.PlayerViewMesh=LodMesh'Botpack.sshockm';
aux.ThirdPersonMesh=LodMesh'Botpack.SASMD2hand';
}
}
-
Rakiayn
- Masterful
- Posts: 550
- Joined: Fri Aug 28, 2009 3:33 pm
Re: Change weapon settings in game?
strange. try to alter the drawscale in the code to 3.0
if you have huge shockrifles in the map, then perhaps my theory is correct.
if not, something is wrong with the code
if you have huge shockrifles in the map, then perhaps my theory is correct.
if not, something is wrong with the code
-
iloveut99
- Skilled
- Posts: 231
- Joined: Mon Aug 16, 2010 10:25 pm
-
Rakiayn
- Masterful
- Posts: 550
- Joined: Fri Aug 28, 2009 3:33 pm
Re: Change weapon settings in game?
use the code in your first post.
doing a for each search in tick function is a very bad idea (can cause lag)
code:
doing a for each search in tick function is a very bad idea (can cause lag)
code:
Code: Select all
function bool CheckReplacement(Actor Other, out byte bSuperRelevant){
if (Other.IsA('ShockRifle')){
ShockRifle(Other).drawscale=3.0;
ShockRifle(Other).DeathMessage="%k electrified %o with the Combo %w.";
ShockRifle(Other).PickupMessage="You got the enhanced Combo Shock Rifle.";
ShockRifle(Other).ItemName="Enhanced Combo Shock Rifle";
ShockRifle(Other).PlayerViewMesh=LodMesh'Botpack.sshockm';
ShockRifle(Other).ThirdPersonMesh=LodMesh'Botpack.SASMD2hand';
return true;
}
}
-
iloveut99
- Skilled
- Posts: 231
- Joined: Mon Aug 16, 2010 10:25 pm
Re: Change weapon settings in game?
I've tried that but seems doesn't work the weapons scale are normal. =/
Yeah I know, I just did that for testing purposes, with it I didn't need to find a function that is called every time when a player pickups a weapon.doing a for each search in tick function is a very bad idea (can cause lag)
-
Rakiayn
- Masterful
- Posts: 550
- Joined: Fri Aug 28, 2009 3:33 pm
Re: Change weapon settings in game?
hmm ok. I guess there is something wrong with the check replacement code
perhaps try it with the tick function code.
perhaps try it with the tick function code.
-
iloveut99
- Skilled
- Posts: 231
- Joined: Mon Aug 16, 2010 10:25 pm
-
Rakiayn
- Masterful
- Posts: 550
- Joined: Fri Aug 28, 2009 3:33 pm
-
iloveut99
- Skilled
- Posts: 231
- Joined: Mon Aug 16, 2010 10:25 pm
-
JackGriffin
- Godlike
- Posts: 3829
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Change weapon settings in game?
CheckReplacement is only called on spawn. Do a ForEach iteration and get them that way. BTW you might have to use Set too.
So long, and thanks for all the fish
-
Rakiayn
- Masterful
- Posts: 550
- Joined: Fri Aug 28, 2009 3:33 pm
Re: Change weapon settings in game?
the problem in this case is that the code is not working at all. not even when the shockrifle is spawned
-
Feralidragon
- Godlike
- Posts: 5503
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: Change weapon settings in game?
If I may:
1 - Changing DrawScale won't lead anywhere: inventory works diferently regarding DrawScale: they have PickupViewScale, PlayerViewScale and ThirdPersonScale. Change those instead from CheckReplacement.
2 - Messages from the weapons are generally read by static functions which only work with default properties and they cannot handle instances, they handle only classes and primitive data types. So no matter how you change it dynamically, the default property will remain the same and can only be changed by a subclass indeed. This applies to DeathMessage, PickupMessage, ItemName.
3 - To make sure your code is affecting the weapon, use "fool-proof" variables instead: MultiSkins, turn the weapon bMeshEnvironment=True, make it translucent, etc, use other universal variables which affect absolutelly all the mesh actors instead.
1 - Changing DrawScale won't lead anywhere: inventory works diferently regarding DrawScale: they have PickupViewScale, PlayerViewScale and ThirdPersonScale. Change those instead from CheckReplacement.
2 - Messages from the weapons are generally read by static functions which only work with default properties and they cannot handle instances, they handle only classes and primitive data types. So no matter how you change it dynamically, the default property will remain the same and can only be changed by a subclass indeed. This applies to DeathMessage, PickupMessage, ItemName.
3 - To make sure your code is affecting the weapon, use "fool-proof" variables instead: MultiSkins, turn the weapon bMeshEnvironment=True, make it translucent, etc, use other universal variables which affect absolutelly all the mesh actors instead.
