Jump to content

Problems with scripting.Help!!


vilkatis

Recommended Posts

I want to make a bottle of nuka cola change to a bottle of ice nuka cola if it is added to a fridge

and this is the script,that i added to the bottle

 

 

scn NukaColaScript

float timer

ref rContainer

float ncount

Begin OnAdd

set timer to 0

set rContainer to GetContainer

if rContainer.GetIsID RefrigeratorWithFood

ShowMessage NukaColaMessage

set ncount to rContainer.GetItemCount NukaCola

if ncount > 0

rContainer.additem MS05IceNukaCola ncount

set ncount to rContainer.GetItemCount MS05IceNukaCola

if timer < 3

set timer to timer + GetSecondsPassed

else

rContainer.removeitem NukaCola ncount

endif

endif

endif

End

 

 

the problem is that the timer doesnt work in onAdd blocks..as it seems

i dont know what to do i tried making a gamemode block to run the timer..and it ends up crashing the game

here it is

 

 

scn NukaColaScript

 

ref rContainer

int nCheck

 

Begin onAdd

set nCheck to 1

set rContainer to GetContainer

if rContainer.GetIsID RefrigeratorWithFood

if (rContainer.GetItemCount NukaCola > 0)

rContainer.additem MS05IceNukaCola 1

endif

endif

end

 

float timer

 

begin GameMode

if nCheck == 1

if timer < 3

set timer to timer + GetSecondsPassed

else

if (rContainer.GetItemCount NukaCola > 0)

removeme

set nCheck to 0

set timer to 0

endif

endif

endif

end

Link to comment
Share on other sites

Thanks!Yeah i changed it and added the script to the fridge.i just didnt want it to run in a GameMode block

can i possibly make it run differently?its my first time using scripts in fallout and i`m inclined to think that GameMode blocks run all the time,so they would slow the performance of the game

is there any check i can do so the script wouldn't run all the time? like only if the player is in vicinity of the fridge or something?

or some other check..

Link to comment
Share on other sites

  • Recently Browsing   0 members

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