Info Panel
________________
FO MOD MASTER THREAD
TES MOD MASTER THREAD

________________


________________
_
November 2017
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
27282930   

Calendar Calendar


Help fixing a Script for Ammo Sorting

View previous topic View next topic Go down

Help fixing a Script for Ammo Sorting

Post by gunslinger6792 on Mon May 26, 2014 3:17 pm

I'm trying to get a script to work that a friend gave me to sort ammo. I want my 5.56mm ammo to go into an ammo box that's ID name is houseammobox4. The geck gives me a warning saying its an invalid reference that only object references and reference variables are allowed in that context. Can anyone here help me out?

Short Playercount

Set PlayerCount to (Player.GetItemCount Ammo556mm)
Player.RemoveItem Ammo556mm PlayerCount 1
houseammobox4.AddItem Ammo556mm PlayerCount 1
avatar
gunslinger6792

Posts : 281
Join date : 2014-04-04
Age : 25
Location : North Carolina, United States

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by hitman47101 on Mon May 26, 2014 9:29 pm

Are you sure that the containers ref ID is houseammobox4 and that it is set as a persistent reference?

Because that script works for me, i just tried it.
avatar
hitman47101

Posts : 1880
Join date : 2014-03-01
Age : 24

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by gunslinger6792 on Tue May 27, 2014 2:13 am

I'll double check but yes I believe so.
avatar
gunslinger6792

Posts : 281
Join date : 2014-04-04
Age : 25
Location : North Carolina, United States

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by gunslinger6792 on Tue May 27, 2014 3:18 pm

I still can't get the script to work I keep getting errors. The ammo box is set to persistent but still no joy.
avatar
gunslinger6792

Posts : 281
Join date : 2014-04-04
Age : 25
Location : North Carolina, United States

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by hitman47101 on Wed May 28, 2014 11:38 am

Sorry its taken me so long to reply.

How exactly are you using this script? an activator or something else?

Edit: This script will work, just attach it to your activator.

scn AmmoSortingScript

Short Playercount

Begin OnActivate

Set PlayerCount to (Player.GetItemCount Ammo556mm)
Player.RemoveItem Ammo556mm PlayerCount 1
houseammobox4.AddItem Ammo556mm PlayerCount 1

End


I hope this helps. Smile
avatar
hitman47101

Posts : 1880
Join date : 2014-03-01
Age : 24

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by gunslinger6792 on Wed May 28, 2014 1:47 pm

I'm trying to use the script in the terminal. The idea being is the player clicks on sort 556ammo and the ammo (in theory) should be removed from the players inventory and placed into houseammobox4 or 5.56mm Ammo (thats the name of the ammo box in game) I tried your script by placing it in terminal but I got the same error. I may just scrap the sorting idea since its complexities seem beyond me. Thank you for trying to help and your replies I think its lack of knowledge on my end thats making this so difficult.
avatar
gunslinger6792

Posts : 281
Join date : 2014-04-04
Age : 25
Location : North Carolina, United States

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by nyaalich on Tue Jun 17, 2014 2:48 pm

Haven't setup a console in a mod before, but I imagine that it works similarly to menus. You'd need to add the script that hitman provided to the script that controls what happens when each console option is selected.
avatar
nyaalich

Posts : 18
Join date : 2014-05-01

View user profile

Back to top Go down

Re: Help fixing a Script for Ammo Sorting

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum