Forum Jump :

Author Message

Ferit  



Posts: 3
Rank:


Level: Member

Country: 00
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-09-02 11:06        
     
First off Hi.
I am having trouble adding a rangefinder or handgun to a players vest / Backpack.

one way I have tried is addWeaponCargo but cannot select the vest as it is not a Object. the backpack can be used with unitbackpack but if the unit has no backpack the weapon is lost.

If you addWeapon it places the weapon into its correct slot but if you have a handgun or pair of rangefinders equipped it overwrites then.

If I could unassignWeapons I could remove the item from its slot then add the new one.
does anyone have any ideas on how to add multiple weapons to a unit.
Thanks


Author Message


Posts: 333
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 28
In-game name:

 
#2 Posted at 2013-09-02 12:00        
     
Why you want to do such a thing? If I had a holster I would put a pistol in it instead of leaving it empty and putting the weapons elsewhere...


Advertisement


Author Message

Ferit  



Posts: 3
Rank:


Level: Member

Country: 00
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2013-09-02 12:24        
     
Well I am making a Class swapping system so you can change your role while in the mission and it saves you gear to add to the new unit created.
this would also not work if you had a shop system where you have a handgun and wanted to buy a second one.

when you addWeapon to the unit it assigns that weapon to the slot automaticly over writing anything in its place.


Author Message


Posts: 333
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 28
In-game name:

 
#4 Posted at 2013-09-02 16:30        
     
about seond weapon you are right.
class save system:
pseudocode
_items = allItems player;
_weapons = allWeaponsPlayer
_magazine = allMagazines player
_backpacks = allBackpacks player
//now you have stored the players gear in the arrays
removeAllItems player
removeAllMagazines player
removeAllWeapons player
removeAllBackpacks player
//now the unit is blank
player addItems newItems
//and so on


Author Message

Ferit  



Posts: 3
Rank:


Level: Member

Country: 00
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2013-09-03 06:46        
     
Thanks Coding I have the entire script and it is working apart from the second weapon.
all I need is if some has any ideas on how to go about adding a second "weapon" without it over writing the first.

try

player addWeapon "Rangefinder";
player addWeapon "Laserdesignator";

and try get both of them both on the unit.

thanks

Added 29 seconds later:

ok looks like there are 2 different tickets brought up about this and one has been assigned so hopefully we get one of them to solve this problem.

Ticket 1
Ticket 2

This post was edited by Ferit (2013-09-03 18:08, ago)