Jump to content

gun attachments .


random person

Recommended Posts

i woke up in the morning and said to my self, i am not waiting for alpha 17 to upgrade my guns , so i started modding .

i started with the scope , the results were nice

300014197_screenshot1.jpg.15fe3f02380d995d32029323f91a613e.jpg

but i had a little problem, the scope was there if its either attached or not

1815632980_screenshot3.jpg.58fcc91cdc2ffa3eef65374be9caa9a3.jpg

screenshot5.jpg.b531d745875a9db2ad4923cf775bcadd.jpg

1694340929_screenshot2.png.f29ed9391b82fb4e3d27e0753e2d04c0.png

<item id="48" name="gunAK47">

<property name="Meshfile" value="#AK47?AK47"/>

<property name="Material" value="metal"/>

<property name="RepairTools" value="repairKit"/>

<property name="HoldType" value="48"/>

<property name="DegradationBreaksAfter" value="false"/>

<property name="SoundJammed" value="weapon_jam"/>

<property name="Attachments" value="Scope"/>

<property name="CrosshairOnAim" value="false"/> <!-- aimTest -->

<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->

<property class="Parts">

<property name="Stock" value="partsAK47_stock"/>

<property name="Receiver" value="partsAK47_receiver"/>

<property name="Pump" value="partsAK47_parts"/>

<property name="Barrel" value="partsAK47_barrel"/>

</property>

<property name="Sound_Sight_In" value="rifle_sight_in"/>

<property name="Sound_Sight_Out" value="rifle_sight_out"/>

<property class="Action0"> <!-- AttackAction -->

<property name="Class" value="Ranged"/>

<property name="Delay" value="0.150"/>

<property name="Auto_fire" value="true"/>

<property name="Crosshair_min_distance" value="13"/> <!-- 13 -->

<property name="Crosshair_max_distance" value="16"/> <!-- 16 -->

<property name="Magazine_size" value="30"/>

<property name="Magazine_items" value="762mmBullet"/>

<property name="Magazine_item_ray_counts" value="1"/>

<property name="Magazine_item_ray_spreads" value="0"/>

<property name="Reload_time" value="3.9"/>

<property name="Bullet_icon" value="uzi"/>

<property name="Sound_start" value="ak47_fire_start"/>

<property name="Sound_repeat" value="Weapons/Ranged/AK47/ak47_fire_lp"/>

<property name="Sound_end" value="Weapons/Ranged/AK47/ak47_fire_end"/>

<property name="Sound_empty" value="weapon_empty"/>

<property name="Sound_reload" value="ak47_reload"/>

<property name="Horde_meter_rate" value="2.5"/>

<property name="Horde_meter_distance" value="20"/>

<property name="Particles_muzzle_fire" value="nozzleflash_ak"/>

<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi"/>

<property name="DamageBonus.head" value="3"/>

<property name="DamageBonus.wood" value="5"/>

<property name="DamageBonus.earth" value="0.2"/>

<property name="DamageBonus.glass" value="1"/>

<property name="Buff" value="critGunAK47"/>

<property name="Buff_chance" value="0.1"/>

<property name="ActionExp" value="1"/>

</property>

<property class="Action1"> <!-- UseAction -->

<property name="Class" value="Zoom"/>

<property name="Zoom_overlay" value="Items/Weapons/HUD/sniper_zoom_overlay"/>

<property name="Zoom_max_out" value="40"/>

<property name="Zoom_max_in" value="15"/>

</property>

<property name="LightSource" value="Scope"/> <!-- Start: Needed for the attachment flashlight -->

<property name="ActivateObject" value="Scope"/>

<property name="AttachmentFlashlight" value="Scope"/> <!-- End: Needed for the attachment flashlight -->

<property name="Group" value="Ammo/Weapons"/>

<property name="ActionSkillGroup" value="Rifles"/>

<property name="CraftingSkillGroup" value="craftSkillGuns"/>

<property name="RepairExpMultiplier" value="10.8"/>

<property name="LightValue" value="0.45"/>

</item>

what am i doing wrong ?

Link to comment
Share on other sites

Not sure, as I have not messed with attachments in Unity, but try unchecking the scope child object to deactivate it before you export the .unity3d file. That way it defaults to no attachment visible.

Link to comment
Share on other sites

Not sure, as I have not messed with attachments in Unity, but try unchecking the scope child object to deactivate it before you export the .unity3d file. That way it defaults to no attachment visible.

nope , now the scope isnt there anymore even when its attached .

Link to comment
Share on other sites

So some code needs to run in order to "show" the scope; my guess is that the code is already in the game, you just need to have the right object name and placement in the tree for it to activate.

i know the function exists , i saw pacco using it in his sdx ranged weapons guide to add a flashlight , but in his video its apears when it assembled to the gun and doesnt apear when its not , but in my case its always there .

Link to comment
Share on other sites

Like Guppy said, you probably cant do what your trying without custom code. That's how we add scopes in Starvation. Add them as a child object and turn that object on and off in code.

 

In the case of the flashlight, the code is already available via xml.

 

<property name="LightSource" value="lightSource"/> <!-- Start: Needed for the attachment flashlight -->

<property name="ActivateObject" value="Attachments/flashlight/lightSource"/>

<property name="AttachmentFlashlight" value="flashlight02"/> <!-- End: Needed for the attachment flashlight -->

 

Pacco used the child name Lightsource, so vanilla code toggle that attachment on and off, and the activate line turns the light on and off.

Link to comment
Share on other sites

Like Guppy said, you probably cant do what your trying without custom code. That's how we add scopes in Starvation. Add them as a child object and turn that object on and off in code.

 

In the case of the flashlight, the code is already available via xml.

 

<property name="LightSource" value="lightSource"/> <!-- Start: Needed for the attachment flashlight -->

<property name="ActivateObject" value="Attachments/flashlight/lightSource"/>

<property name="AttachmentFlashlight" value="flashlight02"/> <!-- End: Needed for the attachment flashlight -->

 

Pacco used the child name Lightsource, so vanilla code toggle that attachment on and off, and the activate line turns the light on and off.

 

youre right, i tried with a flashlight and it worked, but do you have any coding guides?

where did you learn coding?

as i said i am not waiting for alpha 17 to upgrade my guns.

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...