Jump to content

Timing/Item Placement Script


Deleted2746547User

Recommended Posts

Sometimes I feel like I am having a conversation with myself on the boards these days.. :(

 

Anyhoo, I am curious (if anyone is listening... I mean reading)... how do i set a timer to an x marker to cause items to be placed over a period of time.. (and not just "appear" all at one).. for example.. lets say I fire an event that causes sandbags to be enabled and show up in a row... how would I attach a timer where each set up sandbags is placed sequentially one after another over time? To give the effect like its being built?

 

how would you also tie an NPC to the activity... so, it in fact looks like he is builing it... any links to similar scripting would be helpful...

 

thanks for the advice

Link to comment
Share on other sites

set startingDay to GameDaysPassed and set setToBuild to 1 when you want to start building. This should mimic the construction in 2 stages happening two days apart. This can be simplified a lot more but thats up to you. It's a pretty simple script, attach it to a quest or something and set the script update delay to something like every 12 in-game hours or so.

scn MyBuildingScript
float startingDay;
float diff;
float stage;
float startingDay;
short setToBuild;
BEGIN GameMode
  
   if setToBuild == 1
  	 set diff to ( GameDaysPassed - startingDay);
  	 if diff > 2 && stage == 0
  		 set stage to 1;
  		 ;Enable all the first stage model references here
  	 elseif diff > 4 && stage == 1
  		 set stage to 2;
  		 ;Enable all the second stage model references here
  		 set setToBuild to 0;
  	 endif
   endif
END

Edited by Glenstorm
Link to comment
Share on other sites

set startingDay to GameDaysPassed and set setToBuild to 1 when you want to start building. This should mimic the construction in 2 stages happening two days apart. This can be simplified a lot more but thats up to you. It's a pretty simple script, attach it to a quest or something and set the script update delay to something like every 12 in-game hours or so.

scn MyBuildingScript
float startingDay;
float diff;
float stage;
float startingDay;
short setToBuild;
BEGIN GameMode
  
   if setToBuild == 1
  	 set diff to ( GameDaysPassed - startingDay);
  	 if diff > 2 && stage == 0
  		 set stage to 1;
  		 ;Enable all the first stage model references here
  	 elseif diff > 4 && stage == 1
  		 set stage to 2;
  		 ;Enable all the second stage model references here
  		 set setToBuild to 0;
  	 endif
   endif
END

 

 

QUICK QUESTION... would it be possible to assign an NPC to "do" the work? that is, make it look like he is "working" on it piece by piece? thx!

Link to comment
Share on other sites

Well, yes. Theoretically yes.

 

I have gone through the GECK files and all I could find in a quick run-through which looked like it might come useful to you are these:

 

BoomerWeldingMarker

BoomerWorkingLowMarker

BoomerWorkingMidMarker

BoomerWorkingOverheadMarker

 

Just place these around the building site and let loose a generic NPC around the area with a sandbox package. He/she should randomly play the Idles. I have no idea how the idles play though, I haven't gone to the Boomers yet in the play-through. So you might want to go through them to check which one best serves your purpose.

 

Generic NPC package with Sandbox package:

Copy of an existing generic NPC. Remove all factions from the Faction Tab, Remove all AI packages from the AI packages. Right click -> Add. Create a new Sandbox package and set it around editor location. Make sure the "Use Idle marker" is checked. Then observe in-game.

 

Sorry I haven't done this in practice. I wish I knew how to play those idles in GECK.

Edited by Glenstorm
Link to comment
Share on other sites

LOL, you took it the wrong way. The generic NPC is just an assist so that you can watch him play the idle and determine which marker is best for your construction. It's not meant to go with your mod.

 

However, from what you say, if you want to create a random NPC who just exists to build it, this is the way to go:

  • Create a new NPC and strip him of all faction and AI Packages.
  • Right click -> New in the AI Package list.
  • Create a new AI Package (Sandbox): Around editor location (Radius: 500).
  • Under the Sandbox tab, in "Allowed Behaviours", uncheck everything except Conversations and Idle Markers
  • Name the AI package and close the dialog

Now place the NPC near where you want to set up the construction. Place some of the aforementioned Idle Markers near there too. Double Click the NPC and check "Initially Disabled" as well as "Persistent Reference". name the reference something like bbBuilder.


scn MyBuildingScript
float startingDay;
float diff;
float stage;
float startingDay;
short setToBuild;
short npcVisible;
BEGIN GameMode
  
if setToBuild == 1
	;Enable the NPC
if npcVisible == 0
	bbBuilder.Enable
	set npcVisible to 1
endif

		set diff to ( GameDaysPassed - startingDay);
		if diff > 2 && stage == 0
        		set stage to 1;
        		;Enable all the first stage model references here
		elseif diff > 4 && stage == 1
        		set stage to 2;
        		;Enable all the second stage model references here
     ;Assuming this is the last stage. Destroy the NPC here
	bbBuilder.Disable
	bbBuilder.MarkForDelete
        		set setToBuild to 0;
		endif
endif
END

 

Now whenever you set it to build, the NPC should be visible as well, going around and playing the markers.

Edited by Glenstorm
Link to comment
Share on other sites

PS On a related note.... if I have lots of items (junk, clutter, etc.) in a cell...and have a script/quest to clean it up (get rid of it and replace with different items).. woudl teh best way to handle that be to tie the "junk" to an x marker and the items be set enabled opp of parent.? or should I find a script to delete the item/ref. once the quest has been completed? (MarkForDelete?)

 

for example.. I have an offfice and there is junk, clutter, etc.in it... a "quest" will give the player the option of "cleaning house" and all the junk will be removed. a second stage of the quest will put new tables, chairs, etc. where the old junk was..

 

(multiply this x's 4 or 5 buildings and the NCRCF compound... and that would leave a lot of useless "clutter" sitting in memory..?

Edited by Guest
Link to comment
Share on other sites

LOL, you took it the wrong way. The generic NPC is just an assist so that you can watch him play the idle and determine which marker is best for your construction. It's not meant to go with your mod.

 

However, from what you say, if you want to create a random NPC who just exists to build it, this is the way to go:

  • Create a new NPC and strip him of all faction and AI Packages.
  • Right click -> New in the AI Package list.
  • Create a new AI Package (Sandbox): Around editor location (Radius: 500).
  • Under the Sandbox tab, in "Allowed Behaviours", uncheck everything except Conversations and Idle Markers
  • Name the AI package and close the dialog

Now place the NPC near where you want to set up the construction. Place some of the aforementioned Idle Markers near there too. Double Click the NPC and check "Initially Disabled" as well as "Persistent Reference". name the reference something like bbBuilder.


scn MyBuildingScript
float startingDay;
float diff;
float stage;
float startingDay;
short setToBuild;
short npcVisible;
BEGIN GameMode
  
if setToBuild == 1
	;Enable the NPC
if npcVisible == 0
	bbBuilder.Enable
	set npcVisible to 1
endif

		set diff to ( GameDaysPassed - startingDay);
		if diff > 2 && stage == 0
        		set stage to 1;
        		;Enable all the first stage model references here
		elseif diff > 4 && stage == 1
        		set stage to 2;
        		;Enable all the second stage model references here
     ;Assuming this is the last stage. Destroy the NPC here
	bbBuilder.Disable
	bbBuilder.MarkForDelete
        		set setToBuild to 0;
		endif
endif
END

 

Now whenever you set it to build, the NPC should be visible as well, going around and playing the markers.

 

You are the man! I will try to see if I can put that in - MAJOR THANKS!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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