Jump to content

Script to make vendors restock more frequently


Crowley9

Recommended Posts

I tried out Daily Vendor Restock, available here: http://www.nexusmods.com/newvegas/mods/44569/?

 

This did not work for me, so I dug into the mod file (which is why I am posting here and not mod troubleshooting). This script seems to be the heart of the mod:

 

scn merchantResupplyScript
int dayofweek

begin gamemode
set dayofweek to getdayofweek + 1
if dayofweek == 8
set dayofweek to 0
endif

if ( gamehour < 23.8 )
SetNumericGameSetting imerchantrespawnday2 dayofweek
endif


end

 

I can see it is supposed to simply change the game setting iMerchantRespawnDay2 to current day of week + 1. However, this script seems to be somehow fundamentally broken since I can't save and compile it. I can see some minor problems. The "if dayofweek == 8" part should be changed to 7, since the game tracks weekdays 0-6. And I think "if ( gamehour < 23.8 )" would probably be better served by something like "if (gamehour == 23)". However, I don't see what actually is broken about this script.

Edited by Crowley9
Link to comment
Share on other sites

Just the obvious: See "SetNumericGameSetting". The second parameter (dayofweek) is supposed to be a "float". Instead it's initialized as an "integer".

 

See also the comment about "GameDaysPassed" and "GameHour" on the "Global variables for In-Game Time" page before you make that proposed change.

 

-Dubious-

Link to comment
Share on other sites

Here's my altered script, which still doesn't compile:

 

 

scn merchantResupplyScript
float dayofweek

Begin GameMode
set dayofweek to ( GetDayOfWeek + 1 )
if ( dayofweek == 7 )
set dayofweek to 0
endif

if ( gamehour == 23 )
SetNumericGameSetting iMerchantRespawnDay2 dayofweek
endif


End

 

Link to comment
Share on other sites

dayofweek doesn't have to be a float in order to be accepted by that function. It'll accept an int just as fine.

 

In order to get the script to compile, try marking the setting's name as an actual string with quotation marks:

SetNumericGameSetting "iMerchantRespawnDay2" dayofweek

 

If that doesn't work, install the Geck Powerup maintained by hlp, and check if it gives you an error message.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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