Jump to content

Script, What's wrong with it?


JcHARP

Recommended Posts

Ok so, I got this perk ingame and I want it to give 350 caps per day. I get it to work the first time, but how come it will not work over and over again?

 

SCN FWarsQ00PerksScript

Short FWOnce
Short FWOnce2
Short FWOnce3
Short FWOnce4
Short FWOnce5

Begin GameMode

;---------------------------------------------This is for FWarsQ01o1 Perk

If GetCurrentTime >= 24 && GetCurrentTime < 0
Set FWOnce to 0
EndIf

If Player.HasPerk FWarsQ01o1Perk && FWOnce == 0 && Player.GetLevel <= 10 && GetCurrentTime >= 0 && GetCurrentTime < 24
Player.AddItem Caps001 350
Set FWOnce to 1
EndIf

End

 

 

What am I doing wrong?

Link to comment
Share on other sites

Not tried it, but it should work. It will add 350 caps to the player once a day at 12 I hope. Try it and tell me



scn ScriptName

ref Caps

Begin GameMode
Set Caps to Caps001
If Player.HasPerk FWarsQ01o1Perk
    if  Player.GetLevel <= 10 && GetCurrentTime == 12.01
        Player.AddItem Caps 350
    endif
endif
end 
Link to comment
Share on other sites

First, create two quests and tick Start Game Enabled on both boxes.

Name the quest id's something like MySetupQuest and MyMainQuest

 

Ok second, create a new script

 

Put this in

scn MySetupScript

Short Stage

Begin GameMode
  if (Stage != 1)
    SetQuestDelay MyMainQuest 0.1
    Set Stage to 1
  endif
end

 

 

Make the script type Quest. Open your set up quest and put that as the quest script.

 

Now, open a new script and put this

 

scn MyMainScript

ref Caps

Begin GameMode
Set Caps to Caps001
If Player.HasPerk FWarsQ01o1Perk && (MySetupQuest.Stage == 1)
    if  Player.GetLevel <= 10 && GetCurrentTime == 12.01
        Player.AddItem Caps 350
    endif
endif
end 

 

change that script type to quest too.

 

Open up your main quest (MyMainQuest) and use that as the script. Hopefully, this should work

Link to comment
Share on other sites

No need for two quests/scripts here. As Slikpik suggested, make a new, start game enabled quest. Create a new quest-type script (and don't forget to make the new quest use it):

scn FWarsQ00PerksScript

float	fTimer

begin GameMode

	if player.HasPerk FWarsQ01o1Perk && (player.GetLevel <= 10)
		if fTimer == 0
			set fTimer to GameDaysPassed
		elseif (GameDaysPassed - fTimer) >= 1
			player.AddItem Caps001 350
			set fTimer to 0
		endif
	endif

end
Link to comment
Share on other sites

  • Recently Browsing   0 members

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