It is currently Sat Apr 27, 2024 1:28 pm

RUNNING WITH RIFLES Multiplayer

test

Game servers 46 List provided by EpocDotFr | Players online 133


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Jun 22, 2015 3:43 pm 
Offline
User avatar

Joined: Mon Jun 22, 2015 3:06 pm
Posts: 42
Location: MURDER ST., SLAUGHTER CITY
Running With Rifles is a recent purchase for me, but that hasn't stopped me from seeing how far I can get into modding without destroying the game and my sanity in the process. So far, it hasn't been so bad; I've gotten together Strogg, SWAT, and HECU grunts in the voxel tool for some custom character classes me and my friends have been using via campaign save editing.

There's a small problem with that, however. It seems from my experience that non-default character classes cannot spawn with or otherwise access unlocked weapons in the campaign. I mean specifically briefcase and delivery unlocks; we can rank up and access rank-restricted weapons just fine, and even see our NPC allies carrying unlocked weapons, but anyone set to a custom class can only pick them up in the field.

Is there any way to get weapon unlocks to show up for custom character classes or is this a hardcoded limit?

_________________
I'M COOKIN' WITH GAS! I've got a handful of vertebrae and a headful of mad! Yeah! That's your spinal cord, baby! Dig it! Who's the man? I'm the man! I'm a bad man! How bad? Real bad! I'm a 12.0 on the 10.0 scale of badness!


Top
 Profile  
 
PostPosted: Mon Jun 22, 2015 8:21 pm 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
Technically, the AI can spawn with an weapon in the armory that you can see. However, weapons with a spawn_score of "0" in the code, like the SG-553, will never spawn in the hands of the AI.

If you bring the required 5 weapons to an armory to unlock that weapon, then the AI will generally spawn with that. For example, you're playing as the Green and you bring in 5 AK-47s (which has a spawn_score of 0.2, same as the other assault rifles), then the AI will spawn with those and use them.


Top
 Profile  
 
PostPosted: Tue Jun 23, 2015 5:44 am 
Offline
User avatar

Joined: Mon Jun 22, 2015 3:06 pm
Posts: 42
Location: MURDER ST., SLAUGHTER CITY
That wasn't the question I was asking, I'm afraid.

My problem is that players who have been set to a character class other than "default" (in this case, a nearly 1:1 copy of the default class with alternate models and a spawn score of 0) are totally unable to access unlocked weapons in the armory or spawn with them.

I have no issues with NPCs spawning in with unlocked weapons. I learned about that before I even started modding this game.

_________________
I'M COOKIN' WITH GAS! I've got a handful of vertebrae and a headful of mad! Yeah! That's your spinal cord, baby! Dig it! Who's the man? I'm the man! I'm a bad man! How bad? Real bad! I'm a 12.0 on the 10.0 scale of badness!


Top
 Profile  
 
PostPosted: Tue Jun 23, 2015 2:00 pm 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
The Armory unlocks weapons for usage in the default class - so you can only access weapons that are unlocked in that class. You can change that via the unlock_manage.php under scripts. I understand that much. But what you managed to do was to make the player spawn as a different class - which, as far as I know, is impossible.


Top
 Profile  
 
PostPosted: Tue Jun 23, 2015 4:54 pm 
Offline
User avatar

Joined: Mon Jun 22, 2015 3:06 pm
Posts: 42
Location: MURDER ST., SLAUGHTER CITY
It was simple, really. I read somewhere in a thread - which, I can't remember at this moment - that it was possible to manually edit save files to set the character class of a player, and I believe it was Pasik himself that mentioned this. That's what got me started on my custom model binge.

In the header of .person save files, there's soldier_group_name="default". "Default" just needs to be changed to the desired character class and, voila, custom models and loadouts (or so I'm inclined to believe; I haven't tested loadouts yet and want to once I start working on custom weapons).

I must be blind, however, as I can't find where unlock_manager specifies the character class. Am I just not looking hard enough or is new code the solution I should be looking for?

Edit: Found the thread and I was right about the source. "Model-Specific Vest Models?":
http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=7&t=2286#p13928

_________________
I'M COOKIN' WITH GAS! I've got a handful of vertebrae and a headful of mad! Yeah! That's your spinal cord, baby! Dig it! Who's the man? I'm the man! I'm a bad man! How bad? Real bad! I'm a 12.0 on the 10.0 scale of badness!


Top
 Profile  
 
PostPosted: Tue Jun 23, 2015 8:20 pm 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
Since what you're trying to do involved changing save files and not with overlays, I can't really help you - sorry about that. It's not something that you can do via normal overlay and modding means, both the changing of the player's class and the armory unlocks.

The unlock_manager is stored under the scripts folder in the game files. Involves some pretty heavy coding, though.


Top
 Profile  
 
PostPosted: Fri Jun 26, 2015 11:24 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
Code:
   // --------------------------------------------
   public function apply_unlocks() {
      $command =
         "<command class='faction_resources' faction_id='" . $this->faction_id . "'>\n";
      // enable all unlocked resources for the faction
      foreach ($this->unlocks as $key => $unlock) {
         $c = "   <" . $unlock->get_resource()->type . " key='" . $unlock->get_resource()->key . "' />\n";
         $command .= $c;
      }
      $command .=
         "</command>";

      $this->metagame->comms->send($command);
   }

This part would need some sort of change. faction_resources XML command accepts an additional parameter soldier_group_name, which defaults to default.

E.g.
Code:
      $command =
         "<command class='faction_resources' soldier_group_name='custom_group_player' faction_id='" . $this->faction_id . "'>\n";


Similar change for drop_resource function might be in order if you want the unlocked resources to be removed after a time.


Top
 Profile  
 
PostPosted: Sun Jun 28, 2015 6:47 pm 
Offline
User avatar

Joined: Mon Jun 22, 2015 3:06 pm
Posts: 42
Location: MURDER ST., SLAUGHTER CITY
It's always a pleasure to see a developer active on their home turf and a pleasant surprise to see one willing to help the little guy out. Much appreciated!

As much as I realize this is a late reply, I'd also like to extend thanks to The Soldier. I realize how specific this question is and getting me on the right track is more than I probably should have expected.

Now I just need to see how badly I can mangle PHP code and how much bludgeoning I'll need to do to get it to work for me. Thanks again.

_________________
I'M COOKIN' WITH GAS! I've got a handful of vertebrae and a headful of mad! Yeah! That's your spinal cord, baby! Dig it! Who's the man? I'm the man! I'm a bad man! How bad? Real bad! I'm a 12.0 on the 10.0 scale of badness!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group