Jump to content

Fixing a faulty script - Loren


Recommended Posts

Hello everybody!

 

I use the mod Loren among others and when I take a look in my MessageLog it indicates 1 of Loren's scripts don't work correctly.

 

The problem is in line 31 -> if ( greet02==0 && self.GetInCell LOEscortingAMerchantsShipEtiraMidDeck )

 

Here is the whole script

 

 

scriptname LOEscortingAMerchantsShipAntusBincalScript


ref self
ref attacker
short doonce
short greet01
short greet02
short greet03
short greet04

begin Gamemode

if doonce==0
set self to Getself
set doonce to 1
endif

if (self.GetDisposition player)<30
self.moddisposition player 70
endif


if greet01 ==0 && GetDistance player<= 350 ;this part forces Antus Bincal to greet player for the 1st time
set greet01 to 1
self.StartConversation Player greeting
endif


if GetStage LOSTEscortingAMerchantsShipQuest==30
if (greet02==0 && self.GetInCell LOEscortingAMerchantsShipEtiraMidDeck) ; line 31 with the issue
set greet02 to 1
self.StartConversation Player greeting
endif
elseif GetStage LOSTEscortingAMerchantsShipQuest==45
if (greet03==0 && LOSTEscortingAMerchantsShipQuest.ShipUnderAttack==1)
set greet03 to 1
self.StartConversation Player greeting
endif
elseif GetStage LOSTEscortingAMerchantsShipQuest==85
if (greet04==0 && LOSTEscortingAMerchantsShipQuest.EtiraCaptainDead==1)
set greet04 to 1
self.StartConversation Player greeting
endif


endif
end
begin OnHit attacker
if attacker==player
self.StopCombat
endif
If (attacker.GetInFaction LOEAMSEtiraCrewFaction==1)
self.StopCombat
attacker.StopCombat
endif
end
;<CSEBlock>
;<CSECaretPos> 790 </CSECaretPos>
;</CSEBlock>

 

 

Can anybody among you help me fix it?

 

I would be very grateful.

Edited by Oblivionaddicted
Link to comment
Share on other sites

What does the message say exactly? What about this line makes it not work correctly?

 

The line itself "looks" innocent enough to me from a first view, and I'll have to download the mod and investigate the plugin otherwise, to see what could be wrong with it.

Link to comment
Share on other sites

MessageLog displays these kinds of warnings about this script

 

-2018/04/18 01:37:05 [00516B46] [WARNING] Script 'LOEscortingAMerchantsShipAntusBincalScript', line 3: Error Executing line (Offset 468).

-2018/04/18 01:37:07 [00516B46] [WARNING] Script 'LOEscortingAMerchantsShipAntusBincalScript', line 31: Error Executing line (Offset 468)

Link to comment
Share on other sites

Hmm, well, that message's about as unhelpful as it can get, when it comes to diagnosing runtime errors. We can't even be sure it is the same line #, in this context. The offset though should always be right.

 

Well, looks like we won't be getting anywhere, if not taking a look directly into the plugin. I'll try to do that later, if my free time allows for it, but I can't make any promises.

 

Hmm, but in the meantime, you could try it with if ( greet02==0 && 1 == self.GetInCell LOEscortingAMerchantsShipEtiraMidDeck ) for once.

 

Or try if ( greet02==0 ) && ( 1 == self.GetInCell LOEscortingAMerchantsShipEtiraMidDeck ) even for maximum isolation.

 

And if all else fails, try it without "self.", just GetInCell alone, which like GetDistance will be run on the active reference, that is the object the script runs on.

Link to comment
Share on other sites

just a wild guess

it could be that the GetSelf is broken in that script

so use original resource rather than GetSelf (since the script can recognize its master)

my suggestion is like this

scriptname LOEscortingAMerchantsShipAntusBincalScript

ref attacker
short greet01
short greet02
short greet03
short greet04

begin Gamemode

if GetDisposition player < 30
    moddisposition player 70
endif
      

if greet01 == 0 && GetDistance player <= 350  ;this part forces Antus Bincal to greet player for the 1st time
    set greet01 to 1
    StartConversation Player greeting
endif


if GetStage LOSTEscortingAMerchantsShipQuest == 30
   if (greet02 == 0 && GetInCell LOEscortingAMerchantsShipEtiraMidDeck) ; line 31 with the issue
       set greet02 to 1
       StartConversation Player greeting        
   endif
elseif GetStage LOSTEscortingAMerchantsShipQuest == 45
   if (greet03 == 0 && LOSTEscortingAMerchantsShipQuest.ShipUnderAttack == 1)
       set greet03 to 1
       StartConversation Player greeting        
   endif
elseif GetStage LOSTEscortingAMerchantsShipQuest == 85
   if (greet04 == 0 && LOSTEscortingAMerchantsShipQuest.EtiraCaptainDead == 1)
       set greet04 to 1
       StartConversation Player greeting        
   endif


endif
end
begin OnHit attacker
    if attacker == player
      StopCombat
    endif
    If attacker.GetInFaction LOEAMSEtiraCrewFaction
		StopCombat
        attacker.StopCombat
    endif
end
;<CSEBlock>
;<CSECaretPos> 790 </CSECaretPos>
;</CSEBlock>
Link to comment
Share on other sites

Thank you both for your suggestions, I'm going to try and I'll tell you if it works.

 

EDIT: None of your solutions worked but I found a fix on my own. :-)

Edited by Oblivionaddicted
Link to comment
Share on other sites

  • Recently Browsing   0 members

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