Forum Jump :

Author Message


Posts: 115
Rank:


Level: Member

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

 
#1 Posted at 2009-11-07 22:13        
     
Ive search for the solution for this but no luck and I cant seem to find what Im doing wrong. I tried making an Custom ammo box but the scripts seem to do nothing. I open the ammo box and nothing has changed.

Here is the script: I have it named "ammobox.sqf"
_crate = __crate select 0

clearMagazineCargo _crate
clearWeaponCargo _crate

_crate addWeaponCargo ["M16A2", 10]; 
_crate addWeaponCargo ["M16A2GL", 10]; 
_crate addWeaponCargo ["m16a4", 10]; 
_crate addWeaponCargo ["M16A4_GL", 10]; 
_crate addWeaponCargo ["m16a4_acg", 10]; 
_crate addWeaponCargo ["M16A4_ACG_GL", 10]; 
_crate addWeaponCargo ["M4A1",  10]; 
_crate addWeaponCargo ["M4A1_AIM", 10]; 
_crate addWeaponCargo ["M4A1_AIM_CAMO", 10]; 
_crate addWeaponCargo ["M4A1_RCO_GL", 10]; 
_crate addWeaponCargo ["M4A1_AIM_SD_CAMO", 10]; 
_crate addWeaponCargo ["M4A1_HWS_GL", 10]; 
_crate addWeaponCargo ["M4A1_HWS_GL_CAMO",  10]; 
_crate addWeaponCargo ["M4A1_HWS_GL_SD_CAMO", 10]; 
_crate addWeaponCargo ["M4SPR", 10]; 
_crate addWeaponCargo ["m8_Carbine", 10]; 
_crate addWeaponCargo ["m8_CarbineGL", 10]; 
_crate addWeaponCargo ["m8_Compact", 10]; 
_crate addWeaponCargo ["m8_Sharpshooter", 10]; 
_crate addWeaponCargo ["m8_SAW", 10]; 
_crate addWeaponCargo ["G36A", 10]; 
_crate addWeaponCargo ["G36K", 10]; 
_crate addWeaponCargo ["G36C", 10]; 
_crate addWeaponCargo ["G36_C_SD_Eotech", 10]; 
_crate addWeaponCargo ["MG36", 10]; 
_crate addWeaponCargo ["DMR", 10]; 
_crate addWeaponCargo ["MP5A5", 10]; 
_crate addWeaponCargo ["MP5SD", 10]; 
_crate addWeaponCargo ["M249", 10]; 
_crate addWeaponCargo ["M240", 10]; 
_crate addWeaponCargo ["MK_48", 10]; 
_crate addWeaponCargo ["M24", 10]; 
_crate addWeaponCargo ["M40A3", 10]; 
_crate addWeaponCargo ["m 107", 10]; 
_crate addWeaponCargo ["M 1014", 10]; 
_crate addWeaponCargo ["Colt1911", 10]; 
_crate addWeaponCargo ["M9", 10]; 
_crate addWeaponCargo ["M9SD", 10]; 
_crate addWeaponCargo ["M136", 10]; 
_crate addWeaponCargo ["SMAW", 10]; 
_crate addWeaponCargo ["Javelin", 10]; 
_crate addWeaponCargo ["Stinger", 10]; 
_crate addWeaponCargo ["AK_47_S", 10]; 
_crate addWeaponCargo ["AK_74", 10]; 
_crate addWeaponCargo ["AK_74_GL", 10]; 
_crate addWeaponCargo ["AKS_74_Kobra", 10]; 
_crate addWeaponCargo ["AKS_74_PSO", 10]; 
_crate addWeaponCargo ["AKS_74_U", 10]; 
_crate addWeaponCargo ["AKS_74_UN_Kobra", 10]; 
_crate addWeaponCargo ["RPK_74", 10]; 
_crate addWeaponCargo ["PK", 10]; 
_crate addWeaponCargo ["SVD", 10]; 
_crate addWeaponCargo ["Makarov", 10]; 
_crate addWeaponCargo ["MakarovSD", 10]; 
_crate addWeaponCargo ["RPG7V", 10]; 
_crate addWeaponCargo ["Strela", 10]; 
_crate addWeaponCargo ["AK_47_M", 10]; 
_crate addWeaponCargo ["huntingrifle", 10]; 
_crate addWeaponCargo ["AK_ 107_Kobra", 10]; 
_crate addWeaponCargo ["AK_74_GL_Kobra", 10]; 
_crate addWeaponCargo ["AK_ 107_PSO", 10]; 
_crate addWeaponCargo ["AK_74_GL_PSO", 10]; 
_crate addWeaponCargo ["Pecheneg", 10]; 
_crate addWeaponCargo ["SVD_Camo", 10]; 
_crate addWeaponCargo ["ksvk", 10]; 
_crate addWeaponCargo ["VSS_Vintorez", 10]; 
_crate addWeaponCargo ["Saiga12K", 10]; 
_crate addWeaponCargo ["RPG18", 10]; 
_crate addWeaponCargo ["MetisLauncher ", 10]; 
_crate addWeaponCargo ["Igla", 10]; 

_crate addMagazineCargo ["20Rnd_556x45_Stanag", 100]; 
_crate addMagazineCargo ["30Rnd_556x45_Stanag", 100]; 
_crate addMagazineCargo ["30Rnd_556x45_StanagSD", 100]; 
_crate addMagazineCargo ["30Rnd_556x45_G36", 100]; 
_crate addMagazineCargo ["30Rnd_556x45_G36SD", 100]; 
_crate addMagazineCargo [" 100Rnd_556x45_BetaCMag", 100]; 
_crate addMagazineCargo ["FlareWhite_M203", 100]; 
_crate addMagazineCargo ["FlareGreen_M203", 100]; 
_crate addMagazineCargo ["FlareRed_M203", 100]; 
_crate addMagazineCargo ["FlareYellow_M203", 100]; 
_crate addMagazineCargo ["1Rnd_HE_M203", 100]; 
_crate addMagazineCargo ["1Rnd_Smoke_M203", 100]; 
_crate addMagazineCargo ["1Rnd_SmokeRed_M203", 100]; 
_crate addMagazineCargo ["1Rnd_SmokeGreen_M203", 100]; 
_crate addMagazineCargo ["1Rnd_SmokeYellow_M203", 100]; 
_crate addMagazineCargo ["20Rnd_762x51_DMR", 100]; 
_crate addMagazineCargo ["30rnd_9x19_MP5", 100]; 
_crate addMagazineCargo ["30rnd_9x19_MP5SD", 100]; 
_crate addMagazineCargo ["200Rnd_556x45_M249", 100]; 
_crate addMagazineCargo [" 100Rnd_762x51_M240", 100]; 
_crate addMagazineCargo ["5Rnd_762x51_M24", 100]; 
_crate addMagazineCargo [" 10Rnd_127x99_M 107", 100]; 
_crate addMagazineCargo ["8Rnd_B_Beneli_74Slug", 100]; 
_crate addMagazineCargo ["7Rnd_45ACP_1911", 100]; 
_crate addMagazineCargo ["15Rnd_9x19_M9", 100]; 
_crate addMagazineCargo ["15Rnd_9x19_M9SD", 100]; 
_crate addMagazineCargo ["M136", 100]; 
_crate addMagazineCargo ["SMAW_HEAA", 100]; 
_crate addMagazineCargo ["SMAW_HEDP ", 100]; 
_crate addMagazineCargo ["Javelin", 100]; 
_crate addMagazineCargo ["Stinger", 100]; 
_crate addMagazineCargo ["30Rnd_762x39_AK47", 100]; 
_crate addMagazineCargo ["30Rnd_545x39_AK", 100]; 
_crate addMagazineCargo ["30Rnd_545x39_AKSD", 100]; 
_crate addMagazineCargo ["75Rnd_545x39_RPK", 100]; 
_crate addMagazineCargo [" 100Rnd_762x54_PK", 100]; 
_crate addMagazineCargo [" 10Rnd_762x54_SVD", 100]; 
_crate addMagazineCargo ["8Rnd_9x18_Makarov", 100]; 
_crate addMagazineCargo ["8Rnd_9x18_MakarovSD", 100]; 
_crate addMagazineCargo ["PG7V", 100]; 
_crate addMagazineCargo ["PG7VL", 100]; 
_crate addMagazineCargo ["PG7VR", 100]; 
_crate addMagazineCargo ["OG7 ", 100]; 
_crate addMagazineCargo ["Strela", 100]; 
_crate addMagazineCargo ["5x_22_LR_17_HMR", 100]; 
_crate addMagazineCargo ["5Rnd_127x 108_KSVK", 100]; 
_crate addMagazineCargo [" 10Rnd_9x39_SP5_VSS", 100]; 
_crate addMagazineCargo ["8Rnd_B_Saiga12_74Slug", 100]; 
_crate addMagazineCargo ["RPG18", 100]; 
_crate addMagazineCargo ["AT13", 100]; 
_crate addMagazineCargo ["Igla", 100]; 
_crate addMagazineCargo ["HandGrenade", 100]; 
_crate addMagazineCargo ["NVGoggles", 10]; 
_crate addMagazineCargo ["Binocular", 10]; 

Exit

I have this as the init of the ammo box I want this script to work with:
[this] exec "ammobox.sqf"

Also this is for a shooting range mission. This way all I have to do is add a addon weapon in the script and I can go try it out at the range :D

This post was edited by Peregrine (2009-11-07 22:19, ago)


Author Message

Nightrain  

I blow you away


Posts: 963
Rank:


Level: Former Staff

Country: us
Location:
Occupation:
Age: 22
In-game name:

 
#2 Posted at 2009-11-07 23:03        
     
In the initialization line try this:
ok = [this] execVM "ammobox.sqf";

Give a shot and get back to me.

:cheers
Nightrain

Armstrong-"Hey Carillo, do you see that?"
Carillo-"See what?"
Armstrong-"Something's burning over there, see the smoke?"
Carillo-"That's not smoke it's dust!"
Armstrong-"Dust? i don't get it."

Advertisement


Author Message


Posts: 115
Rank:


Level: Member

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

 
#3 Posted at 2009-11-07 23:18        
     
I gave that a try Nightrain and it didnt work.

I start the mission, ran over to the ammobox and when I open the ammobox for the gear it is still all the same.


Author Message

Nightrain  

I blow you away


Posts: 963
Rank:


Level: Former Staff

Country: us
Location:
Occupation:
Age: 22
In-game name:

 
#4 Posted at 2009-11-07 23:24        
     
Ok, then instead of placing the command in the initialization line do this.

1. Make a trigger, set the activation to anybody, present. Make the axis big, like 1000

2. In the OnAct of the trigger put this:
ok = [] execVM "ammobox.sqf";

3. Start the mission and try it again.

:cheers
Nightrain

Armstrong-"Hey Carillo, do you see that?"
Carillo-"See what?"
Armstrong-"Something's burning over there, see the smoke?"
Carillo-"That's not smoke it's dust!"
Armstrong-"Dust? i don't get it."

Author Message


Posts: 115
Rank:


Level: Member

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

 
#5 Posted at 2009-11-07 23:32        
     
That didnt work either. I tryed something else after that didnt work. I removed the script from the folder to see what will happen. When I start the mission without the script in the folder it says can not find the script ammobox.sqf. So the script is activating I guess. Is there something wrong with the script itself?


Author Message

Nightrain  

I blow you away


Posts: 963
Rank:


Level: Former Staff

Country: us
Location:
Occupation:
Age: 22
In-game name:

 
#6 Posted at 2009-11-07 23:34        
     
I don't know that much about scripting. Give it another day and maybe a more experienced person might know.
I don't know why that exit is at the end, try it without it there.

:cheers
Nightrain

Armstrong-"Hey Carillo, do you see that?"
Carillo-"See what?"
Armstrong-"Something's burning over there, see the smoke?"
Carillo-"That's not smoke it's dust!"
Armstrong-"Dust? i don't get it."

Author Message


Posts: 115
Rank:


Level: Member

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

 
#7 Posted at 2009-11-07 23:43        
     
Tried it without the exit and still now luck. I use to use this script in ArmA 1 and it worked fine. I guess it doesnt like ArmA 2.

I guess if it really need to, Ill rar it, upload it to my FTP and post a DL link here.


Author Message

Nightrain  

I blow you away


Posts: 963
Rank:


Level: Former Staff

Country: us
Location:
Occupation:
Age: 22
In-game name:

 
#8 Posted at 2009-11-07 23:55        
     
After some looking, try putting this in the intialization line:
nul0 = [this] execVM "ammobox.sqf";

:cheers
Nightrain

Armstrong-"Hey Carillo, do you see that?"
Carillo-"See what?"
Armstrong-"Something's burning over there, see the smoke?"
Carillo-"That's not smoke it's dust!"
Armstrong-"Dust? i don't get it."

Author Message


Posts: 115
Rank:


Level: Member

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

 
#9 Posted at 2009-11-08 02:50        
     
Ive tried other types of scripts that should of worked but no luck. Maybe its just me.

Heres the file:
Range Test

Its a very early WIP. Took me awhile to find the spot with little vegetation. After getting the weapon problem fixed up, I will be working on cleaning things up.

If anyone can find out what Im doing wrong, Thanks!!


Author Message


Posts: 1238
Rank:


Level: Member PFS

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

 
#10 Posted at 2009-11-08 02:50        
     
_crate = __crate select 0


It looks like your have an error here, there are two underscores in the second crate.

Your also missing ; at the end of the first few lines.


Author Message

Nightrain  

I blow you away


Posts: 963
Rank:


Level: Former Staff

Country: us
Location:
Occupation:
Age: 22
In-game name:

 
#11 Posted at 2009-11-08 13:18        
     
F2kSel :
_crate = __crate select 0


It looks like your have an error here, there are two underscores in the second crate.

Your also missing ; at the end of the first few lines.

Nice catch, I didn't even notice that.

Armstrong-"Hey Carillo, do you see that?"
Carillo-"See what?"
Armstrong-"Something's burning over there, see the smoke?"
Carillo-"That's not smoke it's dust!"
Armstrong-"Dust? i don't get it."

Author Message


Posts: 115
Rank:


Level: Member

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

 
#12 Posted at 2009-11-08 20:57        
     
Just got done trying that and no luck. Im going to give this a break today and try again tomorrow. If anyone does download the file and see's what I'm doing wrong please tell.


Author Message


Posts: 1054
Rank:


Country: en
Location: 15 Bajo Valor Road, Everon, Sahrani.
Occupation: Air Training Corps, Airsoft + College.
Age: 21
In-game name: grimfist

 
#13 Posted at 2009-11-08 22:23        
     
heres a crate I made, compare them and see what you did wrong

Init line of crate in editor:
[this] exec "WScrate.sqs"

Script:
; *******************
; Made By Grimfist
; West Special Crate
; *******************

; Get the crate parameter given
_crate = _this select 0

; Remove the stock items from the crate
clearMagazineCargo _crate
clearWeaponCargo _crate

; Add the items to the crate
_crate addWeaponCargo ["Binocular", 1]
_crate addWeaponCargo ["M4A1_Aim_camo", 2]
_crate addWeaponCargo ["M4A1_HWS_GL_camo", 1]
_crate addWeaponCargo ["M4A1_AIM_SD_camo", 4]
_crate addWeaponCargo ["Mk_48", 1]
_crate addWeaponCargo ["m136", 1]
_crate addWeaponCargo ["M9SD", 4]
_crate addMagazineCargo ["30Rnd_556x45_Stanag", 40]
_crate addMagazineCargo ["100Rnd_762x51_M240", 6]
_crate addMagazineCargo ["m136", 1]
_crate addMagazineCargo ["15Rnd_9x19_M9SD", 20]
_crate addMagazineCargo ["SmokeShellGreen", 10]
_crate addMagazineCargo ["HandGrenade_West", 20]
_crate addMagazineCargo ["1Rnd_HE_M203", 20]
_crate addMagazineCargo ["FlareGreen_M203", 5]
_crate addMagazineCargo ["1Rnd_SmokeGreen_M203", 5]
_crate addMagazineCargo ["PipeBomb", 2]

Exit


Author Message


Posts: 115
Rank:


Level: Member

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

 
#14 Posted at 2009-11-08 23:49        
     
Grim thank you so much for posting that. I found my problem. There was a few extra spaces in the quotation marks I had. This is a load of my back :D

Anyways, Thank You All So Much!!