Jump to content

Scripting question


achillesdave

Recommended Posts

I have made a test script for a magazine sorter for my mod that will place the issue on the shelf when activated. Ive got it to work by making one issue a reference and initially disabled but it only works one time. The next time I try to put the same issue in again it does not show up on the shelf. What I want to do is make the reference repeatable. Could you look at my script and offer some advice?

 

 

scn AFMDisplayScript

 

begin OnActivate

if IsActionRef player == 1

 

 

if (player.GetItemCount actionformen245 == 1)

AFM245.Enable

Player.RemoveItem actionformen245 1

endif

else

ShowMessage NoMagazines

endif

endif

end

Edited by achillesdave
Link to comment
Share on other sites

I have made a test script for a magazine sorter for my mod that will place the issue on the shelf when activated. Ive got it to work by making one issue a reference and initially disabled but it only works one time. The next time I try to put the same issue in again it does not show up on the shelf. What I want to do is make the reference repeatable. Could you look at my script and offer some advice?

 

 

scn AFMDisplayScript

 

begin OnActivate

if IsActionRef player == 1

 

 

if (player.GetItemCount actionformen245 == 1)

AFM245.Enable

Player.RemoveItem actionformen245 1

endif

else

ShowMessage NoMagazines

endif

endif

end

 

I'm not sure if this is your question, but are you asking for a second copy of AFM to be placed alongside the first one if the player has got two? What is AFM245? I know its a reference but where is it located? Is it on the shelf? How many similar references are there on the shelf?

Link to comment
Share on other sites

Instead of placing a disabled magazine, try placing an X marker on the shelf, with the REF AFM245

 

scn AFMDisplayScript

begin OnActivate
if IsActionRef player == 1

	if (player.GetItemCount actionformen245 == 1)
		AFM245.PlaceAtMe actionformen245 1
		Player.RemoveItem actionformen245 1
	else
		ShowMessage NoMagazines
	endif
	
endif
end

 

Edit - or actually just leave the magazine on the shelf disabled, as it already has the REF ID. The script I posted would be the same, and would guarantee that the placeAtme magazine will have the same orientation as the disabled original.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...