Jump to content

Trying to get this piece of script to save but the geck rejects it


dieangel68

Recommended Posts

This piece of script is not saving, the geck gives no errors but it's just... not saving.

 

scn kdcMiaDialogScript Script

short MiaTalked							; 1 = Player talked to Mia at least once (open the shop option).

short MiaHiredCompanion				; 1 = Player hired Mia

short NPCHungerLevel					; 100 = Starving
short NPCThirstLevel						; 100 = Dehidration
short NPCSleepLevel						; 100 = Sleep deprivation

short NPCHungerRate					; 5
short NPCThirstRate						; 5
short NPCSleepRate						; 5


short MiaCompanionWait				; 1 = Player told Mia to wait

short MiaMentionCaravan				; 1 = Player knows that Mia Plays Caravan.

short MiaMentionPipBoy				; 1 = Player knows that Mia has a broken pipboy
short MiaBootSectorCharged			; 1 = Bootloader has been charged in the pipboy

short init;
float	tick_length;
float 	next_tick;
short 	current_day;

;This instruction block execute every single frame
begin GameMode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;INIT BLOCK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if init == 0 
	set tick_length to 0.5									;HALF AN HOUR (INGAME)
	set next_tick to GetCurrentTime + tick_length
	set current_day to GameDaysPassed
	set init to 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIN LOOP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
elseif MiaHiredCompanion == 1
	;With this mechanic, if the player fast forward, it should compensate
	;by executing the function as many time as needed to catch up with the time.
	if GetCurrentTime >= next_tick or GameDaysPassed < current_day
		
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;NEEDS DEGRADATION;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		set NPCHungerLevel to NPCHungerLevel 	+ NPCHungerRate
		set NPCThirstLevel 	to NPCThirstLevel 	+ NPCThirstRate
		set NPCSleepLevel 	to NPCSleepLevel 	+ NPCSleepRate

		set next_tick to next_tick + tick_length
		if GameDaysPassed < current_day and GetCurrentTime < next_tick
			;If we notice that we are one day later and time is wrong we do a 24 hours flyback to set the clock to the proper position for the next tick

			set current_day to current_day + 1
			set next_tick to next_tick - 24

		endif
	
	endif
endif
end

Link to comment
Share on other sites

You have multiple Script names

 

scn kdcMiaDialogScript Script

 

Remove the last script. ;)

 

Man do i feel dumb now...

 

Second question... is there a "smarter" way to make this convoluted hunger/thirst/sleep timer system than using a gamemode block?

 

Good question, haha. I say, if it works - Go for it! :laugh: I really lack the know-how on that part. :wacko:

Link to comment
Share on other sites

Thank you for the tips!

 

Also... What would be the best way to apply a malus due to dehidration/hunger/sleep deprivation, can we add a perk to a NPC for example? i'm trying to apply stats malus to my npc while they are in starvation.

Edited by dieangel68
Link to comment
Share on other sites

  • Recently Browsing   0 members

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