Editing weapon options

Discussions on Modding of S.T.A.L.K.E.R. SoC & Clear Sky

Editing weapon options

Postby VINTAR on 11 Aug 2009 06:35

Dont know why, but i asked this question on the "other side" shouldve asked here first. Can you edit the weapon options. Like when you right click on a weapon it gives you the option to use, drop etc. I want to add an option to repair. I dont think anyone has tried to do a repair mod like fallout3. I've found the script that tells an npc whether or not a weapon is better than theirs and whether to pick it up or not and was thinking maybe it could be tweaked to repair weapons as it already checks their condition. What do you guys think, is it possible?
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa

Re: Editing weapon options

Postby VINTAR on 11 Aug 2009 13:35

Does this make sense in theory? (and bear with me cause I`m not a scripters ass :D )

right click weapon, choose repair, then script as follows :

function repair_weapon ()
If unstrapped_weap:id == active_weap:id
then total_cond = unstrapped_weap_cond + active_weap_cond
if total_cond > 0
then if total_cond > max_weap_cond
then active_weap_cond = max_weap_cond
unstrapped_weap_cond = 0
drop_unstrapped_weap
else active_weap_cond = total_cond
unstrapped_weap_cond = 0
drop_unsrapped_weap
end
else return false
end
else return false
end
end

LOL maybe you scripters will laugh at this, but does it makes sense in theory?
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa

Re: Editing weapon options

Postby busetibi on 11 Aug 2009 14:00

dunno shit about modding but line 11 (drop_unsrapped_weap) is spelt wrong (you missed the t) so I dont think it would work (you spelt it right in all the other lines)
User avatar
busetibi
Senior Resident
 
Posts: 464
Joined: 12 Sep 2008 23:17
Location: Gold Coast, Australia

Re: Editing weapon options

Postby ket on 11 Aug 2009 15:09

I suck at scripting, but in theory what you want to do is possible. You may need to make your own commands though and find a way of getting the game to recognise them.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Re: Editing weapon options

Postby Nightwatch on 12 Aug 2009 03:05

It would be very difficult to add a "repair" option on right-click menu. It'd require a sort of work akin to Zenobian's DLL zoom. You can already use the repair-box/tool and traders' repair functions.
NEWSA.SIMBION_TWEAK 3.0
Mod Website= Features, Video, Tips & Download Link: NEWSA.SIMBION_Tweak

Watch the Trailer: http://www.youtube.com/watch?v=1Ajw_f8K ... re=channel
Please Do Not download and install any files from links other than those on the Mod's Website
User avatar
Nightwatch
Site Admin
 
Posts: 2676
Joined: 13 Apr 2007 05:42
Location: London, United Kingdom

Re: Editing weapon options

Postby VINTAR on 12 Aug 2009 06:33

What if i created a new function similar to the scope attachable one called weapon_repair. Then i could say for example : otype = self.object:active_weapon[%id] if self.object.active_weapon [%id] == "wpn_groza" (make list of weapons) then otype = "item" if otype == "item" then self.object.active_weapon:weapon_repair
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa

Re: Editing weapon options

Postby Nightwatch on 13 Aug 2009 17:57

I haven't been a developer in GSC, so can't speak with the same authority of one, but it's my understanding that the engine checks the pre-defined variables when a weapon right clicked, then further checks if those variables are active in the relevant weapon_name.ltx files (if so, in what way) or not (e.g. as 0,1,2 --as pre-defined values again)
if scope_status is given 2 then it'll be offered to be attached , if 0 then not, for example.
engine checks the right click assigned variables' pre-defined values, e.g. 0, 1, 2 .
I don't think you can force a new different "function" on the variable, if you are thinking to change the function of a current variable in the game.
I don't mean it cannot be ever made, but such an answer can only come from the likes of original AMK team and Russo, in addition to the GSC developers. (ps: some AMK members have had connections with GSC, anyway, as far as I'm aware)
---------------

PS: as a side note, I wouldn't think a Fallout 3 style "weapon repair ability by using found weapons" could be helpful in SoC. Because, while there are quite few weapons in Fallout 3 from which you can take parts and repair your own weapon, in SoC there are bundles of weapons tossed around, and if that would be the case then your weapon would never get even a slight change to deteriorate, because there will a more than a few in avery couple steps which would be available as a repair parts. Just a thought, though. :mozilla_smile:
NEWSA.SIMBION_TWEAK 3.0
Mod Website= Features, Video, Tips & Download Link: NEWSA.SIMBION_Tweak

Watch the Trailer: http://www.youtube.com/watch?v=1Ajw_f8K ... re=channel
Please Do Not download and install any files from links other than those on the Mod's Website
User avatar
Nightwatch
Site Admin
 
Posts: 2676
Joined: 13 Apr 2007 05:42
Location: London, United Kingdom

Re: Editing weapon options

Postby VINTAR on 14 Aug 2009 06:41

Yeah. I agree the amount of weapons is ridiculous in shoc. But for looting addicts like me, it would be nice to be able to merge weapons together making one worth more and saving on weight. This mod i'm trying is not easy for a first, but dammit i'm trying hard :-)
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa

Re: Editing weapon options

Postby shadow_state on 17 Aug 2009 07:29

I've found the script that tells an npc whether or not a weapon is better than theirs and whether to pick it up or not


which script file is this?


.
shadow_state
New Member
 
Posts: 13
Joined: 18 Jan 2009 08:17

Re: Editing weapon options

Postby VINTAR on 24 Aug 2009 07:28

Sorry shadow, just saw this post now. Its the state_manager.script or something like that.
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa

Re: Editing weapon options

Postby shadow_state on 25 Aug 2009 07:05

thanks.

Do you know how this could be modded so that NPCs don't evaluate the condition or whether or not it has ammo in it when they pick it up?
shadow_state
New Member
 
Posts: 13
Joined: 18 Jan 2009 08:17

Re: Editing weapon options

Postby VINTAR on 25 Aug 2009 09:14

I suppose you can comment out the evaluator section but i dont know what ripple effect this would have, like if the function is called in bind.stalker or somewhere you would get the error: trying to call global :evaluator [a nil value] or something like that. Hey i'm just a noob who happened upon the file :-)
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa


Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 24 guests