Jump to content
  • Sign Up
IGNORED

Oblivion scripting error question...


Recommended Posts

Hello. I am a newbie who wants to learn how to script something. 

Recently, I found a mod called "Tamriel Resource Exchange" and the concept of the mod is pretty good so I installed it and played some. 

But scripts seems doesn't work at all or half working I think... I tried to contact with the modder but he/she did not answer yet but I really want to see it working because The idea was too good...

I cannot upload whole mod but I just want to know that the moder is doing right... below is some part of the scripting... 

 

 scn TRXCornFarmControlScript

int choice
int NumWorkers
int choosing
int ProductionFlag
int curMonth

int DaysSincePaid
int DayPaid
int wages
int Salary = 325

int earnings

Begin OnActivate
set choosing to -1
End

Begin GameMode

if (gameday == 28 && Player.getfactionrank TRXCornFarmFaction == 1 && curMonth != gameMonth)
    if (NumWorkers == 3)
        set earnings to rand 4800 5200
    elseif (NumWorkers == 2)
        set earnings to rand 2800 3200
    elseif (NumWorkers == 1)
        set earnings to rand 800 1200
    else
        set earnings to 0
    endif
    cornmoneychest.additem gold001 earnings
    set curMonth to gameMonth
endif

if (NumWorkers >= 1)
    set DaysSincePaid to gamedayspassed - daypaid
endif

if (NumWorkers == 0 && ProductionFlag == 0)
    set DaysSincePaid to gamedayspassed - daypaid
    set productionflag to 1
endif

if (choosing == -1)
    if (productionflag == 0)
        Messagebox "Controls:", "Hire Worker", "Fire Worker", "Halt Production", "Pay Workers"
        set choosing to 1
    elseif (productionflag == 1)
        Messagebox "Controls:", "Hire Worker", "Fire Worker", "Continue Production", "Pay Workers"
        set choosing to 1
    endif
elseif (choosing == 1)
    set choice to getbuttonpressed
    if (choice == 0)
        set choosing to 10        
    elseif (choice == 1)
        set choosing to 11        
    elseif (choice == 2)
        set choosing to 12    
    elseif (choice == 3)
        set choosing to 13
    endif
elseif(choosing == 10)
    if (NumWorkers == 3)
        Message "Maximum amount of workers for this facility reached."
    elseif (NumWorkers == 2)
        cornworker03.enable
        set NumWorkers to NumWorkers + 1
    elseif (NumWorkers == 1)
        cornworker02.enable
        set NumWorkers to NumWorkers + 1
    elseif (NumWorkers == 0)
        cornworker01.enable
        set NumWorkers to NumWorkers + 1
        message "Worker Hired"
        set productionflag to 0
    endif
    set choosing to 0;---------------------------------------------Close Menus
elseif(choosing == 11)
        if (NumWorkers == 3)
            if (DaysSincePaid > 5 && player.getgold > Salary)
                cornworker03.disable
                set NumWorkers to NumWorkers - 1
                player.removeitem gold001 Salary
            else
                message "You can not afford severance pay at this time."
            endif
        elseif (NumWorkers == 2)
            if (DaysSincePaid > 5 && player.getgold > Salary)
                cornworker02.disable
                set NumWorkers to NumWorkers - 1
                player.removeitem gold001 Salary
            else
                message "You can not afford severance pay at this time."
            endif
        elseif (NumWorkers == 1)
            if (DaysSincePaid > 5 && player.getgold > Salary)
                cornworker01.disable
                set NumWorkers to NumWorkers - 1
                player.removeitem gold001 Salary
            else
                message "You can not afford severance pay at this time."
            endif
        elseif (NumWorkers == 0)
            Message "There are no workers to fire in this facility"
        endif
    set choosing to 0;---------------------------------------------Close Menus
elseif(choosing == 12)
        if (ProductionFlag == 0)
            set ProductionFlag to 1
        elseif (ProductionFlag == 1)
            set ProductionFlag to 0
        endif
    set choosing to 0;---------------------------------------------Close Menus
elseif(choosing == 13)
        if (DaysSincePaid >= 14)
            set wages to Salary * NumWorkers
            player.removeitem gold001 wages
            set daypaid to gamedayspassed
        else
            Message "You do not need to pay wages yet"
        endif
    set choosing to 0;---------------------------------------------Close Menus
endif

if (DaysSincePaid > 17)
    CornWorker01.disable
    CornWorker02.disable
    CornWorker03.disable
    set NumWorkers to 0
    set DaysSincePaid to 0
    set productionflag to 1
endif

End

 

 

The function is simple. If I buy a corn farm, farm control (an object looks like a book) appears and I can mange the farm with the book. 

But the book seems not working now... 

Link to comment

To start a business you need to have a trading level of 100. Could this be the case?

 

 

Well, I went to the office and bought a corn farm, then went to the farm, and activated the controller book - to hire workers ... Then I got tired ...

Link to comment

The gold mine maybe works.   Everything is in the mine.  Also the book.

But the mine cell door is not connected with the world door. So you can not enter the mine.   You can  fix it in the CS and then try if the mine works.

 

esp with connected door and some TES4Edit cleaning and path grid in all cells.

BXX Tamriel Resource Exchange clean.esp

 

 

the problem with the "not moving workers" can be because there is no pathgrid in the cells "Stables Main Building" , "Fishery" , "Gold Mine" and "Farmhouse".

Only the "Vinyard Storage" and "Tamriel Resource Exchange" cells had path grid.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...