Scope help for mod. -1 reply

Please wait...

Guest

I didn't make it!

0 XP

 
#1 10 years ago

Please bear with me as this thread may be a little lengthy as I wish to provide as much detail as possible and be clear in what I am trying to achieve. I am writing a mod that is a rifle mod. This is my forth mod. I am in the testing phase and all is working, except I have found an annoying little glitch. It has to do with my scopes, in praticular the SUSAT. To bring you up to speed, here is what my mod is about: Prices for rifles have been changed. Hit power has been changed to be more appropriate to the weapon class. Bullet speeds and range have been increased to match ammo class. Sniper rifles now have 10x scopes, hit harder and greater range. ALL rifles have multi fire rates, except sniper (SVD and SVU). ALL rifles now have silencer capability (some via tech upgrade only) and all tech mods are available to use. Bear in mind that some tech mods may have an effect that works against another, so choose wisely. Also upgrade factors have been improved and costs have been changed accordingly to improvement. IE: Rifles can carry more ammo in a clip with upgrade, but the cost to do this has gone up dependent on the weapon and the number of rounds added. Standard scopes are improved in power. IE: a 2x = 4x, 4x = 6x. Exception is the FN2000 scope which is really in 5x, not powers of 6. Yes.... a mystery to me, something hard coded. New weapons and weapon upgrade XML TEXT that reflects the weapon a little more accurate. Didn't change .dds icon files with this release to reflect changes. English text only, sorry. IE: in L85A1, tech upgrade SUSAT Scope upgrade icon shows 4x when it really is a 6x, though text is correct. Binoculors have been given a 10x power rating. Grenade launchers have a slightly betty range and hit impulse radius. Silencers.... they go phttt, what else can I say. Knife is stronger and has a slightly better reach. RPG and grenades not added to this mod. Now that you have a general idea, taking the L85A1 as example, in the tech upgrade you have the ability to buy an upgraded scope of 4x power. I have changed this to 6x since my base scopes are now 4x not 2x. No problem it works fine and does the power increase when installed after buying it..... BUT, when you buy another upgrade or put on a silencer, it reverts back to a 4x scope. This has shown to be true of any upgrade scope that you can buy from a tech. This change does not effect standard scopes that I have already changed in power. IE: the PSO-1 and SUSAT scopes that are standard, they remain at the 4x level I have set, same is true of sniper rifles that are fixed. They remain at 10x and Vintorez at 6x. It only effects an add on from the upgrade with a tech that it reverts back. I have spent a lot of time looking at the code to try and figure out why this is happening. I'm stumped. Why does the scope revert back? Here is the code as I have changed it using the pertainate L85A1 and weapons.ltx as example: [COLOR=red]w_l85.ltx[/COLOR] ;addons scope_status = 1 silencer_status = 2 grenade_launcher_status = 0 zoom_enabled = true ; (on,off)zoom mode (right mouse button) zoom_rotate_time = 0.25 scope_zoom_factor = 30 ; fov for zoom mode scope_texture = wpn_crosshair_l85 [COLOR=red]scope_name = wpn_addon_scope [/COLOR][COLOR=green]<<>>[/COLOR] scope_x = 60 scope_y = -2 silencer_name = wpn_addon_silencer silencer_x = 196 silencer_y = 11 grenade_launcher_name = wpn_addon_grenade_launcher_m203 grenade_launcher_x = 128 grenade_launcher_y = 28 [COLOR=red]w_l85_up.ltx[/COLOR] [up_sect_h_l85] cost = 2500 value = "x6" [COLOR=red]scope_zoom_factor = -20 ;30[/COLOR] [COLOR=green]the attributes relating to it in the same file are:[/COLOR] [COLOR=red][up_h_l85][/COLOR] scheme_index = 0, 7 known = 1 effects = up_gr_fh_l85 section = up_sect_h_l85 property = prop_scope_4x precondition_functor = inventory_upgrades.precondition_functor_a precondition_parameter = a & b effect_functor = inventory_upgrades.effect_functor_a [COLOR=red]effect_parameter = something_here_h[/COLOR] prereq_functor = inventory_upgrades.prereq_functor_a prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a prereq_params = money(1000), item(habar) [COLOR=red]name = st_upg_scope_4x_opt [COLOR=green]<<>>[/COLOR] description = st_upg_scope_4x_opt_descr [/COLOR][COLOR=green]<<>>[/COLOR] icon = ui_wp_upgrade_28 [COLOR=green]<<< this is the icon>>>[/COLOR] I believe the probem lies in the attribute, but have no idea how to fix it. I have played with several lines and had no luck. IE: I have removed the 'h' in effect_parameter, but that did nothing. It will still change back to a 4x if I do a change to the rifle after the purchase of the 6x. As far as base in the weapons.ltx They are as follows and as far as I know only effect the standard scopes. The reason I say this is because I did try to change the SUSAT to 6x, and it becomes that for all weapons as a standard.... not what I want. The goal was to make the standard 4x and the tech upgrade a 6x as coded above. [COLOR=red]Weapons.ltx[/COLOR]: [wpn_addon_scope]:identity_immunities GroupControlSection = spawn_group discovery_dependency = $spawn = "weapons\addons\scope" ; option for Level Editor [COLOR=green]<<< This is for the standard add on PSO scopes>>>[/COLOR] class = WP_SCOPE cform = skeleton visual = dynamics\weapons\wpn_upgrade\wpn_scope.ogf $prefetch = 32 description = st_addon_scope_descr cost = 1000 holder_range_modifier = 1.2 holder_fov_modifier = 0.3 inv_name = st_addon_scope inv_name_short = st_addon_scope inv_weight = .2 inv_grid_width = 2 inv_grid_height = 1 inv_grid_x = 18 inv_grid_y = 2 scope_texture = wpn_crosshair [COLOR=red]scope_zoom_factor = 15 ;ÏÑÎ-1 4X [/COLOR][COLOR=green]<<>>[/COLOR] [wpn_addon_scope_4x]:identity_immunities [COLOR=green]<<< This is for the PSO scopes like on Vintorez>>>[/COLOR] GroupControlSection = spawn_group discovery_dependency = $spawn = "weapons\addons\scope_4x" ; option for Level Editor class = WP_SCOPE cform = skeleton visual = dynamics\weapons\wpn_upgrade\wpn_scope.ogf $prefetch = 32 description = enc_weapons1_wpn-addon-scope cost = 1500 holder_range_modifier = 1.2 holder_fov_modifier = 0.3 inv_name = wpn-addon-scope_4x inv_name_short = wpn-addon-scope_4x inv_weight = .3 inv_grid_width = 2 inv_grid_height = 1 inv_grid_x = 18 inv_grid_y = 2 scope_texture = wpn_crosshair [COLOR=red]scope_zoom_factor = 10 ;ÏÑÎ-1 6X [/COLOR]<<>> [wpn_addon_scope_susat]:identity_immunities [COLOR=green]<<>>[/COLOR] GroupControlSection = spawn_group discovery_dependency = $spawn = "weapons\addons\scope_susat" ; option for Level Editor class = WP_SCOPE cform = skeleton visual = dynamics\weapons\wpn_upgrade\wpn_scope_susat.ogf description = st_addon_scope_susat_descr slot = -1 ;$prefetch = 64 cost = 1500 holder_range_modifier = 1.3 holder_fov_modifier = 0.3 inv_name = st_addon_scope_susat inv_name_short = st_addon_scope_susat inv_weight = .2 inv_grid_width = 1 inv_grid_height = 1 inv_grid_x = 19 inv_grid_y = 1 scope_texture = wpn_crosshair_l85 [COLOR=red]scope_zoom_factor = 15 ;SUSAT 4X [/COLOR][COLOR=green]<<>>[/COLOR] I hope that someone can help me get past this annoying little glitch I have with the tech upgrade scopes. I'm stumped and have spent way to much time to throw the idea away. I'm sure I'm overlooking something small in the upgrades ltx. Please point me in the right direction to fix this. Thank you in advance! ABB




WARCATT

I'm Working on it!!!

50 XP

14th September 2008

0 Uploads

424 Posts

0 Threads

#2 10 years ago

have you tried to adjust the range modifier plus the zoom factor, use the same numbers in the fixed scopes your trying to duplicate and copy them here. remember to place the number like this.. holder_range_modifier = number;1.3 holder_fov_modifier = number;0.3 this ; is used so you can have the original number back if it dosn't work. because the program will ignor andything to the right of it... and this is just a shot in the dark, no pun intended..




Guest

I didn't make it!

0 XP

 
#3 10 years ago

TY Warcatt, [COLOR=black]I'll try to tinker with it and see what I come up with. Like you said, a shot in the dark, better than nothing at all.[/COLOR] I'm slowly becoming convinced that it really has to do with the property = prop_scope_4x line, though I can find no reference to this in any of the other files. I believe that there is a subroutine that controls this and I need to set the scopes upgrade power there as well... if there truely is a subroutine. Seems logical to me. All attemps that I've done today have been a flub. Nothing has worked, the scope will continue to revert back to a 4x after the next upgrade done to the rifle. It won't stay at the 6x level once this is done..... what I mean is that it will stay.... as long as I don't change anything after, meaning no mods, gernade launcher or silencer added after the 6x upgrade.




Guest

I didn't make it!

0 XP

 
#4 10 years ago

Well Warcatt, I tried and no success. I tried several number variations. I don't think it has anything to do with my code or anything for that matter, it simply is a glitch in the game itself. I tried an experiment with the L85 and FN2000 in vanilla code. I tried to add the upgrade scope and it worked by itself..... but as soon as I added another upgrade or put the silencer on, bam... went back to the original scope setting. Take the silencer off, and it stayed at the original 2x. Hmmmm, made me think what the heck! Anyway, I was wondering if someone else could verify this 'glitch' in a vanilla setting. I've been pulling my grey hair for the last few days on this and just want to make sure I'm not getting senile ;) After you buy the 4x scope upgrade don't do anything else to the rifle. Step outside and zoom in on a target. Now make a change, like put a silencer on and see if it doesn't fall back to a 2x power scope.