J
JohnSebek
Guest
So, I have created an inventory system, and it also switches guns. To make it more resource-friendly, I used the parent object for all guns so the inventory system just switches it up. But now, all the guns shoot the same as the first weapon player has in hand, and keep the same values such as fire rate, ammo capacity, etc.
This is the item that switches the weapon
This is the item that switches the weapon
Code:
Create Event:
call the inherited event of the parent object
execute code:
///initial variables
item_count_maximum=1
inventory_explorer_in_range_required=0
item_name="Broomhandle"
item_description="German Classic"
item_target=obj_player
Other Event: User Defined 0:
call the inherited event of the parent object
execute code:
///condition
if ds_grid_height(obj_inventory_tracker.my_inventory_grid)<obj_inventory_tracker.maximum_inventory_cursor_row
and ds_grid_width(obj_inventory_tracker.my_inventory_grid)<_inventory_tracker.maximum_inventory_cursor_column
{
condition_accepted=1
}
else
{
condition_accepted=0
}
Other Event: User Defined 1:
call the inherited event of the parent object
execute code:
///action
with (obj_inventory_tracker.my_target)
{
with (o_gunpar)
{
instance_change(o_broomhandle)
}
}