Jump to content

Quick Question - Quick Answer


Cipscis

Recommended Posts

  • Replies 804
  • Created
  • Last Reply

Top Posters In This Topic

I'm having a random encounter function (similar to Talon Co. or the Regulators), but I want it to only appear every 3 days. I can't get anything to do with GameDaysPassed to work, since that deals with how many days have passed since the start of the game itself... any ideas?

The rest of the script is fine, but the only part I need is the timer part of it itself. A normal timer won't work, since that's in seconds and I need days. (unless I set the timer to like 86000 or something :P )

Link to comment
Share on other sites

Set a variable to gamedayspassed, then compare gamedayspassed to that variable. Make sense?

 

short encounterstart

Begin GameMode

set encounterstart to gamedayspassed

if gamedayspassed - encounterstart >= 3
 do encounterstuff
 set encounterstart to gamedayspassed
endif

End

 

something like that

Link to comment
Share on other sites

Well, 1 game day is 2880 real seconds, so 3 days would be 8640 seconds using getsecondspassed. You could also use gamedayspassed by storeing the value when the script fires, then comparing that to the current gamedays passed like this:

 

If Lastdate + 3 > gamedayspassed

 

Where LastDate is set to GameDaysPassed in the code segment where you fire off your encounter.

Link to comment
Share on other sites

Set a variable to gamedayspassed, then compare gamedayspassed to that variable. Make sense?

 

short encounterstart

Begin GameMode

set encounterstart to gamedayspassed

if gamedayspassed - encounterstart >= 3
 do encounterstuff
 set encounterstart to gamedayspassed
endif

End

 

something like that

 

Well, 1 game day is 2880 real seconds, so 3 days would be 8640 seconds using getsecondspassed. You could also use gamedayspassed by storeing the value when the script fires, then comparing that to the current gamedays passed like this:

 

If Lastdate + 3 > gamedayspassed

 

Where LastDate is set to GameDaysPassed in the code segment where you fire off your encounter.

Both of these are good ideas, I'll try these out!

Link to comment
Share on other sites

@thefourwings:

Have you tried using GetDeadCount?

 

@mytheos:

If I remember correctly, you can create non-script archetype base effects that deal damage over time.

 

@portbash:

MenuMode doesn't work like that as a function. Because it's possible for multiple MenuModes to be active at the same time, you need to pass the relevant code to MenuMode as a parameter. It will return either 1 or 0:

if MenuMode 1002

@EMH:

Always keep in mind that "TimeScale" can be changed. GetSecondsPassed should only ever be used for measuring time in real seconds, and only for relatively short timers.

 

Using GameDaysPassed is the way to go here, although I'd recommend storing the finishing time in a variable so that you don't need to perform an extra operation every time you check if it has been reached:

set fFinishTime to GameDaysPassed + 3
...
if GameDaysPassed > fFinishTime

Cipscis

Link to comment
Share on other sites

Hallo everyone, I just have question about my script which doesn't have worked. It is for the "cutscene" in my mod. Problem is, that I was trying to create cutscene which does the following: Flashback-like effect, player controls disabled, Imagespace modifier (looks like hallucination), after some seconds, player will be able to move around, and then, scene will end, and controls will be enabled and IMOD disabled. Also, player will have some Scriptpackage which makes him to "Fall down".

 

 

For some reason, this scene has every time some error/bug in it: like the flashback-effect and sound will work but, then no other things will happen. Or even more annoying, the cripplehead-sound will be playing continuously with LOUD vloume, making me to turn the volume off. I thought I haven't understood how to set up the timer.

Any clearance will be appreciated. :thanks: :whistling:

 

scn LQ01StartScript

float timerA 
short Startup
float timerB
float timerC
short falldown

begin ontriggerenter player   ; This is the timeframe from start to the actual flash.

		if startup == 0
			playsound3d FXExplosionGrenadeConcussion
                               set falldown to 1
                               player.addscriptpackage MQ08PlayerFallsDownPackage
			imod MQ08FadeInFromWhiteISFX
			pipboyradiooff
                               disableplayercontrols 1 1 1 1 0 1 1 
			set timerA to 3
                               set startup to 1
             endif
End

begin gamemode 

    		if timerA < 0	  ; This is the function series which sets on the ImageSpaceModifier.
		   											
		 imod explosioninface	    
                 	 set timerB to 7
                  	 set startup to 2
	else
		Set TimerA to ( TimerA - GetSecondsPassed )

	endif
End

begin gamemode ; This enables player moving around, while feeling like if the player was having headache. ;)

	if startup == 2
		 if ( TimerB < 0 )
                               player.removescriptpackage MQ08PlayerFallsDown    
                               enableplayercontrols 0 1 1 1 0 0 1
			player.playsound FXCrippleHead
			set timerC to 7
	  else
			Set TimerB to ( TimerB - GetSecondsPassed )

               endif
        endif
End


begin gamemode 
	 if ( TimerC < 0 )         ; Here IMOD will be disabled and player will be able to move around (full controls).
	      
                     rimod explosioninface
                     enableplayercontrols 
                     set startup to 3

          	else 
			Set TimerC to ( TimerC - GetSecondsPassed )

         endif
End
                     

                   

Link to comment
Share on other sites

Cipscis, thanks for the follow-up.

 

I saw GetDeadCount in the wiki and wondered if that might do what I wanted. Does it return the number of specified creature dead within that interior cell? If my creature in question is only used in this particular cell, would I populate the cell with them and then attach an onDeath script to the base creature that checks to see if getdeadcount equals the total number I've created in the cell?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...