Jump to content

A little help fixing bugs in my mod....


Deleted2746547User

Recommended Posts

Ok, here is what I have and I can't make it save...

 

Scn BlackbriarNorthernRedoubtBuild

short BlackBriarMetalResourcevariable
short BlackbriarGlassResourcevariable
short BlackbriarHammervariable
float BlackBriarMetalResourcevariable
float BlackbriarGlassResourcevariable
float BlackbriarHammervariable


Begin onActivate
       If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 && player.GetItemCount BlackbriarMetalResource >= 2 && player.GetItemCount BlackbriarGlassResource >= 1
            player.removeItem BlackbriarMetalResource 2
            player.removeItem BlackbriarGlassResource 1
            set doOnce to 1
            BlackbriarNorthernRedoubtActivatorRef.enable
       Else
            ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg
       Endif
End

Link to comment
Share on other sites

Like dp said, get geck power up and tell us what the error is.

 

Don't think else is a valid term. Try elseif instead.

You also don't have a variable called doonce. Add

short   doonce

To the variables at the top.

 

Other than that it could be anything, we are assuming all those things you list actually exist. Blackbriarhammer, blackbriarmetalresource, BlackbriarNorthernRedoubtActivatorRef, etc.

Link to comment
Share on other sites

Ok, here is what I have and I can't make it save...

 

Scn BlackbriarNorthernRedoubtBuild

short BlackBriarMetalResourcevariable
short BlackbriarGlassResourcevariable
short BlackbriarHammervariable
float BlackBriarMetalResourcevariable
float BlackbriarGlassResourcevariable
float BlackbriarHammervariable

 

Woah, what happened there, that wasn't in your last script. Why do you have variables declared twice once as a float and once as a short. I'm pretty sure that'd be just asking to get kicked in the nuts. For what your doing you don't need any float vars. Just use the shorts, it's only simple integers. It's not like they'll find 23050504404040504.00032 of a BlackbriarGlassResource

Edited by devinpatterson
Link to comment
Share on other sites

here is what I have and still won;t save. Everything exists: the hammer, resources, etc. Downloading the power up again now.

 

scn BlackbriarNorthernRedoubtActivator

short BlackBriarMetalResourcevariable
short BlackbriarGlassResourcevariable
short BlackbriarHammervariable
short doonce

Begin onActivate
       If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 && player.GetItemCount BlackbriarMetalResource >= 2 && player.GetItemCount BlackbriarGlassResource >= 1
            player.removeItem BlackbriarMetalResource 2
            player.removeItem BlackbriarGlassResource 1
            set doOnce to 1
            BlackbriarNorthernRedoubtActivatorRef.enable; Builds the base
	   BlackbriarNorthRedoubtActivatorRef.disable; removes the activator item from area
       Elseif
            ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg
       Endif
end

Link to comment
Share on other sites

Ok, this works like a gem::::

 

scn BlackbriarNorthernRedoubtActivator

short BlackBriarMetalResourcevariable
short BlackbriarGlassResourcevariable
short BlackbriarHammervariable
short doonce

Begin onActivate
       If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 && player.GetItemCount BlackbriarMetalResource >= 2 && player.GetItemCount BlackbriarGlassResource >= 1
            player.removeItem BlackbriarMetalResource 2
            player.removeItem BlackbriarGlassResource 1
            set doOnce to 1
            BlackbriarNorthernRedoubtActivatorRef.enable; Builds the base
            BlackbriarNorthRedoubtActivatorRef.disable; removes the activator item from area
       Else
            ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg
       Endif
end

 

MAJOR THANKS TO DP, Q & Vienna and Blove!!!!

 

I'm going to post a second script I'm working with that is causing problems to see if/what glaring stands out. but I have one question: should I when cleaning up clutter in an area - not only disable but mark for delete or does it matter? I've been doing that because my assumption has been that disable doesnt stop it from bein loaded, and thus adds one more drag to the system. Is that correct?

Edited by Guest
Link to comment
Share on other sites

You only use one of your declared variables, which is not really a problem.

 

Good to know blove, thanks.

 

 

Ok, this works like a gem::::

 

Cool, glad you got everything working.

 

I'm going to post a second script I'm working with that is causing problems to see if/what glaring stands out. but I have one question: should I when cleaning up clutter in an area - not only disable but mark for delete or does it matter? I've been doing that because my assumption has been that disable doesnt stop it from bein loaded, and thus adds one more drag to the system. Is that correct?

 

I think if you don't mark it for deletion it's adding to player save game bloat.

 

As far as the clutter being loaded, I think disable knocks out the rendering & AI, but they are still in memory.

Edited by devinpatterson
Link to comment
Share on other sites

Ok, here is one I cannibalized from another script. The purpose is to be able (instead of making 900 recipes to convert every single item into a base resource) to deposit items into one of three containers (it would be nice to have one to do this but anyway).... and it takes items in the container, compares them against a list. Items that match the list get turned into the item BlackbriarMetalResource based on their combined weight. Items that aren't on the list just get destroyed.

 

And i also have the Quest, the container and the messages set up. But this one won't save. Going to try again in powerup... but anyway, if anyone notices anything, let me know. THANK YOU

 

[code]Scn BlackbriarMetalizer

Short Button
Short Status
Short Total
Short Num
Short Count
Short Type
Float Weight
Float TotalWeight
Float MetalResources
Ref rItem


Begin onActivate

If Status == 0 && BlackbriarQuest.NVSECheck == 1
       ShowMessage BlackbriarMetalizerMessageNVSE; tells you that NVSE is required and what the metalizer does
       Set Status to 1
elseif Status == 0
       ShowMessage BlackbriarMetalizerMessage; message if you don't have NVSE installed
       Set Status to 1
endif

End


Begin GameMode

If Status == 0
       Return
elseif Status == 1
       Set Button to GetButtonPressed
       If Button == -1 
               Return
       elseif Button == 0
               If BlackbriarQuest.NVSECheck  == 1
                       Set Status to 2
                       Set Total to GetNumItems
                       Set Num to 0
                       Set metalResources to GetWeight SpareParts
                       ;PrintToConsole "Total is %.0f" Total
                       Return
               else
                       RemoveAllItems
               endif
       elseif Button == 1
               Activate Player 0
       endif
       Set Status to 0
elseif Status == 2
       If Num < Total && Total != 0
               Set rItem to GetInventoryObject Num     
               Set Type to GetType rItem
               If Type == 40 || Type == 41 || ListGetFormIndex BlackbriarMetalItemsList rItem != -1
                       Set Weight to GetWeight rItem
                       Set Count to GetItemCount rItem
                       Set Weight to Weight * Count
                       Set TotalWeight to TotalWeight + Weight
                       ;PrintToConsole "%.0f Transforming %.0f %n into %.2f wg of scrap." Num Count ritem weight
               endif
               Set Num to Num + 1
               Return
       else
               If TotalWeight >= BlackbriarMetalResources
                       ;PrintToConsole "Totalweight is %.2f and Scrap metal is %.2f" TotalWeight BlackbriarMetalResources
                       RemoveAllItems
                       Set Count to TotalWeight / BlackbriarMetalResources
                       AddItem SpareParts Count
                       Set TotalWeight to TotalWeight - ( Count * BlackbriarMetalResources )
                       ;PrintToConsole "%.2f wg left over" TotalWeight
               endif
               Set Status to 0
       endif
endif

[/code]

 

 

 

Ran it through Cipscis (THANKS BLOVE): and it gave me errors on:

 

1. Unknown function for: Getweight, ListGetFormIndex, GetInventoryObject, GetType

Edited by Guest
Link to comment
Share on other sites

  • Recently Browsing   0 members

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