Static Weapons

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 1727
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Static Weapons

Post by Barbie » Fri Dec 09, 2016 4:02 am

Is there any possibility to change the value of GESBioRifle0.bStatic from TRUE to FALSE via code while loading the map? If I do that with

Code: Select all

consolecommand("SET UnrealI.GESBioRifle bStatic false")
it works for the spawned copies but not for GESBioRifle0 that exist before the consolecommand is executed.
Attachments
StaticWeapons.jpg
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
sektor2111
Godlike
Posts: 4167
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Static Weapons

Post by sektor2111 » Fri Dec 09, 2016 7:27 am

Barbie wrote:it works for the spawned copies but not for GESBioRifle0 that exist before the consolecommand is executed.
Not true..., probably you wanna look at DynAI mutator - it screws bStatic NavPoints making them movable and IT WORKS. If you speak about client, that's a different story, but server is the authority anyway... else I have operated a few tweaks for that trash map called MonsterOfSpam whatever version.
Weaponry were changed to non static for being replaced. Copies from client ruined correctly (hidden, small, etc.) New replacements are coming with no issues. Else NsCTF3 does the same things (CTF-Hagman - an utter mess) game runs properly with my custom CTF with no issues.
ConsoleCommand is enough powerful to do even bad things but I'm using it for good purposes. The fact is that you need this "console" code very fast BEFORE to see Replacements called else it doesn't help either. So your issue is the moment when gets called and not if do works or not, if you call it too late doesn't help replacements at all.

Higor
Godlike
Posts: 1777
Joined: Sun Mar 04, 2012 6:47 pm

Re: Static Weapons

Post by Higor » Fri Dec 09, 2016 8:00 am

Pretty simple, mutators process the initial replacement before the BioRifle's bStatic is set to false.
You need an entry point where you get to do this before mutators do their job.

- non-XCGE servers: GameInfo.InitGame >>> A special mutator that catches the very first IsRelevant call and then self-detaches from the chain (uses this call to set bStatic to false).
- XCGE servers: XC_Init event on a XC_Engine_Actor derivate.
- Clients: Weapon needs to be manually hidden because it's not connected to it's server counterpart.
ImageImage
Image unreal://23.111.157.138:7777
Image unreal://46.228.199.205:7788

User avatar
sektor2111
Godlike
Posts: 4167
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Static Weapons

Post by sektor2111 » Fri Dec 09, 2016 4:18 pm

Exactly, in InitGame a lot of things can be restored back to normal and mutator won't even notice if they were being screwed before. I have completed in SpawnNotify little tweaks for client and everything has turned back to normal.
This is one of important reasons for running my games and not any default or a poor coded one.

User avatar
Barbie
Godlike
Posts: 1727
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Static Weapons

Post by Barbie » Mon Dec 12, 2016 6:29 am

sektor2111 wrote:
Barbie wrote:it works for the spawned copies but not for GESBioRifle0 that exist before the consolecommand is executed.
Not true...
Yes, I thought that because I joined the server with a client installation and saw two Weapons there: one not rotating (probably the one with bStatic==True) and one rotating at the same place.
If I check Weapon's bStatic on server after that consolecommand it shows that bStatic is false for it.

What leads me to the next question: That mutator (the map fixer) is designed for server side only, so I guess there is no chance to fix that on clients too if I want to keep the mutator server only?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
sektor2111
Godlike
Posts: 4167
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Static Weapons

Post by sektor2111 » Mon Dec 12, 2016 3:38 pm

If you want to keep server things out of "visitors" you might go for 2 pieces. Package for client having a SpawnNotify thing - (a lot of tweaks might go there) because client feels and see the game, and... Server-Side part. If I'm thinking well they can be completely separate and not even dependent each-other.

Else

see Weapon.bStatic and start poking it with a few kicks in butt:
bRotatingPickup=False
bFixedRotationDir=False
RotationRate 0, 0, 0
Then "consolecommand".
This should trigger weapon to stay and to not create a duplicate crap rotating into client. Because Actor replicates several things and a bStatic weapon fixed will start rotating due to mapper's stupidity in being unable to set a non-rotating weapon, having lousy effects in clients.
Now the amnesia problem:
Because such a weapon might be replaced, old one is preferable to be bHidden at replacement process because copy from client I'm not sure if will be destructible so we need a false destruction applied first for being replicated from server - even some DrawScale 0.003, DrawType DT_None - anything else which gets an automated replication related to visual effects convincing player about a perfect replacement. Else you'll see again lousy things in client. It took a few hours until I found the way for this problem, however I had at a moment even 2 solutions for this chapter "Weapon-Crap" being confused in which one is matching needs or which one is faster in execution.

So to speak in my current noob level of coding I can do a mutator able to replace any weapon from map regarding to sh!t which mappers are setting up against mutators, or because are clueless at Inventory chapter - speaking about a SHOOTER game :loool: .

Post Reply