[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Need some basic help on correctly update variables on dedicatedserver mode  XML
Forum Index -> UnrealScript, Coding, Mapping, and 3rd party Mods
Author Message
Legendary_Agent

Killing Spree

Joined: 08/21/2006 02:57:13
Messages: 33
Offline

Hey all if i knew about this area before i wouldve posted here, well i am from now on, i need desperate help on a very small thing, im trying to change how a specific artifact behaves, im doing this for an artifact that will stay in your inventory, what i want is when its used to change its name to activated, this works fine enough by reassigning itemname in:

function bool shouldBreak()
{
ItemName=Artifact[Activated]
return false;
}


Its working like a charm in offline mode, however in online mode it semms that it also changes successfuly to that name but it doesnt appear on the screen of the player, how can i refresh this so the client will be able to actually notice that name change in dedicated server mode?
do i use tick? or replicate? please help me on this issue as i think its so easy but i really have no clue which to use and how :\

Thanks in advance!
[MSN]
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

The biggest problem by far in UT coding is replication. Getting things you change on the server back out to the clients. It is a minefield, and very difficult to get right. There are all sorts of rules that regulate what gets sent and when - as a general rule, no changes get sent, and every change you want sent you have to force through.

In this case, the ItemName variable in the Inventory class is not contained in a replication statement, and so any changes to it will not get transmitted from the server to the clients. (Note that putting something in a replication statement doesn't mean it will be replicated - but if it isn't it won't) And you can't put it in a replication statement except in the Inventory class. Which you can't change without breaking all sorts of things.
So there is not a simple way to achieve what you are trying to do.

So, the first question is what are you actually trying to achieve?
If this is an RPGArtifact, then if you look at the UT2004RPG RPGArtifact class, you can see that it is based on Powerups, and the Powerups class has a replication statement
Code:
 replication
 {
 	// Things the server should send to the client.
 	reliable if( bNetOwner && bNetDirty && (Role==ROLE_Authority) )
 		NumCopies, bActivatable, bActive;
 }
 
This means that the bActive flag is replicated. So, client side you can test for it being active using that flag.
The Itemname is displayed by the HUD Interaction you are using (dependent on gametype) - you could change this to check for the bActive flag and put Activated instead - but modifying Interactions can cause its own problems.

But I am not sure what you are trying to achieve? The only artifact that I know of that has the shouldBreak function is the MWM (and the superhealer version). Is it a variant of one of these you are after?

Or are you trying to make a single use artifact? Try setting bActivatable to false in shouldBreak.

One option might be to have two artifacts - the current one you are working on and another activated version. Then in your shouldBreak function give yourself the second artifact and destroy this one. Haven't tried it but it may work.

Another option may be to put an overlay on it - like a red cross or something - in the shouldBreak function. That overlay may get replicated - I haven't checked - and so may appear client side - but I doubt it.
Legendary_Agent

Killing Spree

Joined: 08/21/2006 02:57:13
Messages: 33
Offline

hello slatz as usual thank you very much for your replies, since i run a custom weapon mod in my server i needed to make some changes to fix some exploits the biggest one beying to be able to destroy your weapon with ArtifactMakeSuperHealer so you could pick another one again from the ground, this would help you exploit the magic weapon chance system as in: dont like ur weapon? destroy it and get a new one untill u do.
The magic weapons here are very powerfull since they are WOP mutator.

What i was trying to achieve was very simple, after using that artifact once and only after the weapon was generated (cause if i do it in between and enter a vehicle the artifact will activate without making the super healer weapon), to change its name to medic weapon maker [activated] and its icon to something else, (the red version of the icon it originally has).

here is how i do this now, its bullet proof on the vehicle glitch thingie but it doesnt replicate:

Code:
function Activate()
 {
 local Weapon OldWeapon;
 
  if (Used1A==False)
  {
   ....
  }
  else
  Instigator.ReceiveLocalizedMessage(MessageClass, 6000, None, None, Class);
 }
 
 
 static function string GetLocalString(optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2)
 {
 ...
 	if (Switch == 6000)
 		return "Medic PowerUp already activated";
 ...
 }
 
 
 function constructionFinished(RPGWeapon result)
 {
 	...
         FixedRW_SuperHealer1A(result).AMSH = Self;
         ItemName = "Medic PowerUp (ACTIVATED)";
         IconMaterial = Combiner'XGameTextures.SuperPickups.DOMPabRc';
         Used1A=true;
 	...
 }
 
 



Is it ok if i post the whole code in this forum?


The way it would work like that imo it would make it more balanced as my original intention is to stick with the weapon you have instead of picking up the same weapon over and over again untill u get 1 which might be to good.
[MSN]
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

So you are trying to make the ArtifactMakeSuperHealer single use to stop people using it to get better weapons. I see your reasoning.

So really you need a different variant of the ArtifactMakeSuperHealer that breaks after once successful generation. So, create your own version, extending the existing ArtifactMakeSuperHealer class, which just destroys itself after a successful generation.

The problem you then have is that the ArtifactMakeSuperHealer artifact is hard coded into Loaded Medic (and experienced healing, RW_SuperHealer, key binding, medic blast, remote booster, healing sphere etc).

So, in order to go down that route you would also need to subclass all these classes as well.
However, most of these bits of code use something like Other.FindInventoryType(class'ArtifactMakeSuperHealer')
... which will try to find the exact class, but if it can't find one will search for a subclass. The only two that actually craete the superhealer artifact are AbilityExpHealing and AbilityLoadedMedic.

So the quickest way might be to create your own subclassed versions of ArtifactMakeSuperHealer, AbilityLoadedHealing and AbilityExpHealing that use your own single-use artifact for making medic weapons?

But you must have been planning to replace the ArtifactMakeSuperHealer artifact with your own anyway, so you must have already made these changes.

So the simple question is why the complicated "setting to activated and generating messages on multiple uses" rather than just destroying the ArtifactMakeSuperHealer artifact after it has completed its generation?

Have I missed something?
Legendary_Agent

Killing Spree

Joined: 08/21/2006 02:57:13
Messages: 33
Offline

Szlat wrote:
So you are trying to make the ArtifactMakeSuperHealer single use to stop people using it to get better weapons. I see your reasoning.

So really you need a different variant of the ArtifactMakeSuperHealer that breaks after once successful generation. So, create your own version, extending the existing ArtifactMakeSuperHealer class, which just destroys itself after a successful generation.

The problem you then have is that the ArtifactMakeSuperHealer artifact is hard coded into Loaded Medic (and experienced healing, RW_SuperHealer, key binding, medic blast, remote booster, healing sphere etc).

So, in order to go down that route you would also need to subclass all these classes as well.
However, most of these bits of code use something like Other.FindInventoryType(class'ArtifactMakeSuperHealer')
... which will try to find the exact class, but if it can't find one will search for a subclass. The only two that actually craete the superhealer artifact are AbilityExpHealing and AbilityLoadedMedic.

So the quickest way might be to create your own subclassed versions of ArtifactMakeSuperHealer, AbilityLoadedHealing and AbilityExpHealing that use your own single-use artifact for making medic weapons?

But you must have been planning to replace the ArtifactMakeSuperHealer artifact with your own anyway, so you must have already made these changes.

So the simple question is why the complicated "setting to activated and generating messages on multiple uses" rather than just destroying the ArtifactMakeSuperHealer artifact after it has completed its generation?

Have I missed something? 


Because its simpler this way and i will not run into problems with exp healing and loaded healing hp cap.

Btw ive got it working now, if ure interested in the code tell me and ill share it with you.


PS: Unfortunately healing burst is not part of druidsrpg200, druidsrpg200 lacks alot of things that newer version has, i wish there was some sort of agreement that allowed me to run newer version of druids in my server xD.
Well, hopefully i will be able to import some stuff from titanrpg after all that one is free of use.
[MSN]
 
Forum Index -> UnrealScript, Coding, Mapping, and 3rd party Mods
Go to: