Table that detects dwemer stuff, not doing anything.

Post » Fri Nov 16, 2012 12:30 pm

Tell me what's wrong with this script:

Scriptname DetectRemoveScrapScript extends ObjectReference FormList Property Dwemer1ScrapItems autoFormList Property Dwemer2ScrapItems autoFormList Property Dwemer3ScrapItems autoGlobalVariable Property DwemerScrapGlobal autoevent OnTriggerEnter(ObjectReference akActionRef)ObjectReference Near1Scrap = Game.FindClosestReferenceOfAnyTypeInListFromRef(Dwemer1ScrapItems, self, 50)ObjectReference Near2Scrap = Game.FindClosestReferenceOfAnyTypeInListFromRef(Dwemer2ScrapItems, self, 50)ObjectReference Near3Scrap = Game.FindClosestReferenceOfAnyTypeInListFromRef(Dwemer3ScrapItems, self, 50)if Near1Scrap==akActionRefakActionRef.disable(1)DwemerScrapGlobal.SetValue((DwemerScrapGlobal.GetValue() as int) + 1)Utility.Wait(2.5)akActionRef.delete()elseif Near2Scrap==akActionRefakActionRef.disable(1)DwemerScrapGlobal.SetValue((DwemerScrapGlobal.GetValue() as int) + 2)Utility.Wait(2.5)akActionRef.delete()elseif Near3Scrap==akActionRefakActionRef.disable(1)DwemerScrapGlobal.SetValue((DwemerScrapGlobal.GetValue() as int) + 3)Utility.Wait(2.5)akActionRef.delete()endIfendEvent

It's on an activator surrounding a table. When I put things on the table I want it to basically decide if the thing that entered it was a dwemer object, and if so "melt it down" by deleting it and adding a number to a Global that I will use elsewhere. But I drop stuff in the Lists on the table, and nothing happens.
User avatar
Deon Knight
 
Posts: 3363
Joined: Thu Sep 13, 2007 1:44 am

Post » Fri Nov 16, 2012 5:42 pm

NVM: Figured out the problem. Basically I need to do this:

Scriptname DetectRemoveScrapScript extends ObjectReference FormList Property Dwemer1ScrapItems autoFormList Property Dwemer2ScrapItems autoFormList Property Dwemer3ScrapItems autoGlobalVariable Property DwemerScrapGlobal autoevent OnTriggerEnter(ObjectReference akActionRef)ObjectReference Near1Scrap = Game.FindClosestReferenceOfAnyTypeInListFromRef(Dwemer1ScrapItems, self, 505)ObjectReference Near2Scrap = Game.FindClosestReferenceOfAnyTypeInListFromRef(Dwemer2ScrapItems, self, 505)ObjectReference Near3Scrap = Game.FindClosestReferenceOfAnyTypeInListFromRef(Dwemer3ScrapItems, self, 505)if Near1Scrap!=NONENear1Scrap.disable(1)DwemerScrapGlobal.SetValue((DwemerScrapGlobal.GetValue() as int) + 1)Utility.Wait(2.5)Near1Scrap.delete()elseif Near2Scrap!=NONENear1Scrap.disable(1)DwemerScrapGlobal.SetValue((DwemerScrapGlobal.GetValue() as int) + 1)Utility.Wait(2.5)Near2Scrap.delete()elseif Near3Scrap!=NONENear1Scrap.disable(1)DwemerScrapGlobal.SetValue((DwemerScrapGlobal.GetValue() as int) + 1)Utility.Wait(2.5)Near3Scrap.delete()endIfendEvent

and then I need to make it onactivate, as it TriggerEnter only detects actors apparently.
User avatar
Dark Mogul
 
Posts: 3438
Joined: Tue Feb 20, 2007 11:51 am

Post » Fri Nov 16, 2012 10:22 pm

triggerenter will only detet actors if the triggerbox is set to L_ACTORZONE (which is what it is by default). L_TRIGGER will allow it to detect all objects.
User avatar
Luna Lovegood
 
Posts: 3325
Joined: Thu Sep 14, 2006 6:45 pm

Post » Fri Nov 16, 2012 6:22 pm

Ah, thanks!
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am


Return to V - Skyrim