Jump to content

A little Scripting help please?


Nakalto

Recommended Posts

not working like it seems it would. it works but the effect doesnt leave you as of right now. close to getting it to work i think
Link to comment
Share on other sites

short Button
short Timepassed

begin OnActivate

if (IsActionRef player && GameDaysPassed > Timepassed)
	ShowMessage GSChemistrySetMsg
else
	return
endif

end

BEGIN MenuMode 1001

set Button to GetButtonPressed

if ( Button == 1 )
	player.AddItem Stimpak 5
	Set Timepassed to GameDaysPassed + 1
elseif ( Button == 2 )
	player.AddItem Psycho 1
	player.AddItem Buffout 1
	player.AddItem Mentats 1
	player.AddItem NVSteadyChem 1
	player.AddItem NVReboundChem 1
	Set Timepassed to GameDaysPassed + 1 
endif

END

 

all you need to do is put this in the script and it runs

Link to comment
Share on other sites

short Button
short Timepassed

begin OnActivate

if (IsActionRef player && GameDaysPassed > Timepassed)
	ShowMessage GSChemistrySetMsg
else
	return
endif

end

BEGIN MenuMode 1001

set Button to GetButtonPressed

if ( Button == 1 )
	player.AddItem Stimpak 5
	Set Timepassed to GameDaysPassed + 1
elseif ( Button == 2 )
	player.AddItem Psycho 1
	player.AddItem Buffout 1
	player.AddItem Mentats 1
	player.AddItem NVSteadyChem 1
	player.AddItem NVReboundChem 1
	Set Timepassed to GameDaysPassed + 1 
endif

END

 

all you need to do is put this in the script and it runs

Oh wow!! Thanks man!

i really appreciate it :D

maybe i'll put the mod up so you can see what you contributed to :)

Link to comment
Share on other sites

no problem like i tell everyone i love to help because then i learn something new. do you actually understand the script? if not i can explain it for you
Link to comment
Share on other sites

Well, i kinda get it but not entierly. But that is because i today learned how hard scripting can be when you have no prior knowledge :P

i changed the amount of drugs recived from 1 to 3, removed Steady and Fixer, and added Morphine instead. Oh and i also added "scn DrugChemistrySet" att the top of the script, but that is as far as my skills go. (learned that today, read it in a guide :P)

Edit: i now saw that changing the drugs added don't match with the text in the messagebox, but that's not a big deal for me anyway. I am just psyked it works! :D

Edited by Nakalto
Link to comment
Share on other sites

short Button           ; Short means your adding a variable, like a container for values. a short cant hold a decimal so any decimal points are dropped
short Timepassed   ; if you need to use a decimal number, change short to float.  the global i call is a float but i dont care past the decimal so i have the game drop it

 

begin OnActivate     ; this means that this part will run when the object it is attached to is used

       if (IsActionRef player && GameDaysPassed > Timepassed)    ;the Is ActionRef player checks to make sure its the player using the object.  the && means AND so both statements have to pass this check.  
                                                                                                 ;GameDaysPassed > Timepassed checks to see if a day has passed or not
               ShowMessage GSChemistrySetMsg                             ;makes the message box pop up
       else                                                                                    ;runs if the if statement is false (ie doesnt pass both checks)
               return                                                                          ; return means end this script
       endif                                                                                    ; must have at the end of every if statement

end                                                                                              ; must have to close this begin.  every begin must have an end

 

BEGIN MenuMode 1001

       set Button to GetButtonPressed                       ;finds out which button we selected by making our variable equaled to the choice picked, ie 0,1,2

       if ( Button == 1 )                                              ;tells the game what the second menu button does (the one labeled as 1, the first choice to leave it alone is labeled as 0)
               player.AddItem Stimpak 5
               Set Timepassed to GameDaysPassed + 1 ;sets our variable to the gamesetting GameDaysPassed and then adds 1 to it, this is how we simulate the need to wait a day
       elseif ( Button == 2 )                                          ;tells the game what the second menu button does (the one labeled as 2)
               player.AddItem Psycho 1
               player.AddItem Buffout 1
               player.AddItem Mentats 1
               player.AddItem NVSteadyChem 1
               player.AddItem NVReboundChem 1
               Set Timepassed to GameDaysPassed + 1 ;sets our variable to the gamesetting GameDaysPassed and then adds 1 to it, this is how we simulate the need to wait a day
       endif

Link to comment
Share on other sites

all you have to do is find GSChemistrySetMsg under the message tab and type. no scripting there! what you type is what you see
Link to comment
Share on other sites

Well, i kinda get it but not entierly. But that is because i today learned how hard scripting can be when you have no prior knowledge :P

i changed the amount of drugs recived from 1 to 3, removed Steady and Fixer, and added Morphine instead. Oh and i also added "scn DrugChemistrySet" att the top of the script, but that is as far as my skills go. (learned that today, read it in a guide :P)

Edit: i now saw that changing the drugs added don't match with the text in the messagebox, but that's not a big deal for me anyway. I am just psyked it works! :D

 

I believe you have to modify/create a different dialogue box (in GECK terms a Message that pops up a dialogue) rather than using the GSChemistrySetMsg. The message is what determines the box shown to the user. Easiest way would be to filter (All) for GSChemistrySetMsg, Ctrl + D duplicate it, then modify the message prompts [and FormID] to reflect what you are giving the player

 

Edit - too slow heh. I would suggest duplicating it/changing the Form ID though - otherwise Doc's chem set will be overridden and show the message box for your custom set.

Edited by carlosjuero
Link to comment
Share on other sites

  • Recently Browsing   0 members

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