Help with a Custom Script please....

Post » Mon Jun 28, 2010 2:01 am

So, a few weeks back I created my first mod. You can DL it here : http://fallout3nexus.com/downloads/file.php?id=11254

I've been refining it and wanted the ammunition in the ammo box to respawn. However, after clicking on the respawn option I found that it did not respawn. Instead what I did was create a custom script (see this thread here: http://www.gamesas.com/bgsforums/index.php?showtopic=1078539).

Here is what my script looks like:

scn LootAmmoBox40mmGrenade

begin OnActivate

if GetItemCount 40mmGrenade == 0
AddItem 40mmGrenade 10
endif

Activate

end


Now. It does work. I can take the original 10 grenades out of the box. Wait an hour and the grenades are back in there. What my question is, how do I make it so that they respawn a day or two later and how do I get rid of the "40mm Grenade Box [Empty]" even after the grenades are back in? Once I click on the container it shows the normal "40mm Grenade Box".
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Mon Jun 28, 2010 3:38 am

Either change the script to add the ammo when you take it versus when you avctivate the container, or move the script into a gamemode block.
User avatar
dean Cutler
 
Posts: 3411
Joined: Wed Jul 18, 2007 7:29 am

Post » Mon Jun 28, 2010 5:14 am

Ok, how do I do that? I'm sorry, I'm still learning.
User avatar
Ludivine Dupuy
 
Posts: 3418
Joined: Tue Mar 27, 2007 6:51 pm

Post » Mon Jun 28, 2010 2:36 pm

Ok, how do I do that? I'm sorry, I'm still learning.


Replace this: begin OnActivate
with this: Begin GameMode

That will constatly check the contents of your container and replace it as soon as the amount equals zero. So as soon as you leave the container menu, it should be relenished.
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Post » Mon Jun 28, 2010 2:33 pm

Thanks that fixed the spawning thing. Any idea on how to make it so they only respawn say after 2 days? This was you can't get an endless supply just farming the box in your house?
User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Mon Jun 28, 2010 12:55 pm

Try this

short doneshort restockBegin GameModeif restock == gamedayspassed if done == 1   AddItem 40mmGrenade 10   set done to 0endifendifif GetItemCount 40mmGrenade == 0 if done == 0   set Restock to (gamedayspassed + 2)   set done to 1endifendifEnd

User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Mon Jun 28, 2010 9:12 am

You might want to change this line:

if restock >= gamedayspassed

User avatar
Alyesha Neufeld
 
Posts: 3421
Joined: Fri Jan 19, 2007 10:45 am

Post » Mon Jun 28, 2010 11:08 am

You might want to change this line:

if restock >= gamedayspassed


Actually looking now it should have been <=

short doneshort restockBegin GameModeif restock <= gamedayspassedif done == 1   AddItem 40mmGrenade 10   set done to 0endifendifif GetItemCount 40mmGrenade == 0if done == 0   set Restock to (gamedayspassed + 2)   set done to 1endifendifEnd

User avatar
Robyn Lena
 
Posts: 3338
Joined: Mon Jan 01, 2007 6:17 am

Post » Mon Jun 28, 2010 1:37 am

That worked thanks. Although I did have to add this line: scn LootAmmoBox40mmGrenade otherwise it wouldn't save. Thanks again for the help. Also, is there someplace on the internets where I can see the different script commands thazt can be used? On the wiki perhaps?
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Mon Jun 28, 2010 5:05 am

Yep, the GECK has documentation on most available script functions. The http://geck.gamesas.com/index.php/Function_Page would be a good starting point if you want to check out available functions, but if I remember correctly there are a few that aren't listed on that page.

Cipscis
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Mon Jun 28, 2010 4:19 am

Thank you very much. I appreciate it. Where can I find the ones that aren't on there? Is it like a trial and error type thing?
User avatar
Francesca
 
Posts: 3485
Joined: Thu Jun 22, 2006 5:26 pm

Post » Mon Jun 28, 2010 7:14 am

More functions can be found on the TES Wiki for Oblivion. Some are relevant some are not. It also includes a lot of OBSE functions that are not documented on the Geck Wiki for FOSE.

http://cs.elderscrolls.com/constwiki/index.php/Category:Functions
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm

Post » Mon Jun 28, 2010 1:13 pm

Thanks I'll check that info out, I appreciate it. :)
User avatar
Shaylee Shaw
 
Posts: 3457
Joined: Wed Feb 21, 2007 8:55 pm

Post » Mon Jun 28, 2010 1:27 pm

All functions included in the unpatched game can be found listed here - http://fose.silverlock.org/Fallout3Commands.html

All functions added since after the initial release should be documented on the wiki.

Cipscis
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Mon Jun 28, 2010 7:26 am

Oh sweet, thanks. I'm printing that as I type this.
User avatar
Queen of Spades
 
Posts: 3383
Joined: Fri Dec 08, 2006 12:06 pm

Post » Mon Jun 28, 2010 2:52 am

Wouldn't it make much more sense to just save it somewhere on your computer? That way you can use your web browser's built in "find" function (usually accessible via Ctrl+F) to search for functions rather than doing it by eye.

Cipscis
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Mon Jun 28, 2010 4:02 pm

Sure, but sometimes when I have different programs open it is more a pita to switch between windows. I find it a lot easier in those cases to just flip to the page I'm looking for.
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Mon Jun 28, 2010 4:40 am

Wouldn't it make much more sense to just save it somewhere on your computer? That way you can use your web browser's built in "find" function (usually accessible via Ctrl+F) to search for functions rather than doing it by eye.

Cipscis


I learned a long time ago to keep scripts/programs in hard copy as well as digital.. 3-ring binders full of old projects.
User avatar
Dorian Cozens
 
Posts: 3398
Joined: Sat May 26, 2007 9:47 am

Post » Mon Jun 28, 2010 6:13 pm

To each their own, I suppose. So long as the method works, at least. Just be careful to check the wiki's documentation every now and again for any new information that might become available.

Cipscis
User avatar
Emerald Dreams
 
Posts: 3376
Joined: Sun Jan 07, 2007 2:52 pm


Return to Fallout 3