Difference between revisions of "User talk:AdiBeiElderScrolls"
imported>AdiBeiElderScrolls |
imported>AdiBeiElderScrolls |
||
Line 9: | Line 9: | ||
An answer to a special topic then set the RufVernommen variable. | An answer to a special topic then set the RufVernommen variable. | ||
Here is a code summary of the horse | Here is a code summary of the horse | ||
<pre>ScriptName | <pre>ScriptName CompanionHorse | ||
short HeardCall | |||
short | short OnTheWay | ||
short | float OverallDistance | ||
float | short Distance1000 | ||
short | short Distance2000 | ||
short | short Distance3000 | ||
short | short Distance4000 | ||
short | short Distance5000 | ||
short | short Distance10000 | ||
short | short Distance15000 | ||
short | short Distance20000 | ||
short | short Distance25000 | ||
short | short Distance30000 | ||
short | |||
Begin GameMode | Begin GameMode | ||
If ( | If ( Distance1000 == 0) | ||
Set | Set Distance1000 To 1000 | ||
Set | Set Distance2000 To 2000 | ||
Set | Set Distance3000 To 3000 | ||
Set | Set Distance4000 To 4000 | ||
Set | Set Distance5000 To 5000 | ||
Set | Set Distance10000 To 10000 | ||
Set | Set Distance15000 To 15000 | ||
Set | Set Distance20000 To 20000 | ||
Set | Set Distance25000 To 25000 | ||
Set | Set Distance30000 To 30000 | ||
EndIf | EndIf | ||
If | If HeardCall | ||
; | ; load package to travel to companion | ||
If ( GetIsCurrentPackage | If ( GetIsCurrentPackage HorseTravelToCompanion == 0 ) | ||
; | ; remove any currently running package | ||
RemoveScriptPackage | RemoveScriptPackage | ||
; | ; get travel package | ||
AddScriptPackage | AddScriptPackage HorseTravelToCompanion | ||
EvaluatePackage | EvaluatePackage | ||
EndIf | EndIf | ||
Set | Set OverallDistance To GetDistance MyCompanion | ||
Message "Fabians | Message "Fabians Horse has heard the call, it is %.0f away", OverallDistance | ||
; | ; reset vars | ||
Set | Set HeardCall To 0 | ||
Set | Set OnTheWay To 1 | ||
EndIf | EndIf | ||
; | ; check if we have arrived | ||
If | If OnTheWay | ||
If ( GetDistance | If ( GetDistance MyCompanion < 1000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand1000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 2000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand2000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 3000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand3000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 4000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand4000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 5000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand5000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 10000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand10000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 15000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand15000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 20000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand20000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 25000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand25000 | ||
ElseIf ( GetDistance | ElseIf ( GetDistance MyCompanion < 30000 ) | ||
Message "Fabians | Message "Fabians horse is less than %.0f away", Abstand30000 | ||
EndIf | EndIf | ||
If ( GetDistance | If ( GetDistance MyCompanion < 350 ) | ||
; | ; close enough to cancel travel package | ||
If ( GetIsCurrentPackage | If ( GetIsCurrentPackage HorsePCStay == 0 ) | ||
RemoveScriptPackage | RemoveScriptPackage | ||
AddScriptPackage HorsePCStay | |||
AddScriptPackage | |||
EndIf | EndIf | ||
; | ; reset var | ||
Set | Set OnTheWay To 0 | ||
EndIf | EndIf | ||
EndIf | EndIf |
Revision as of 18:31, 7 November 2006
Hi out there, in this great Wiki!
I've learned a lot here, as this wiki provides a lot of helpful hints, but still some questions I can't solve.
I'm still fighting with a good solution for this companion thing. There is some helpful code for having companions with horses, that follow. But it doesn't really work well. Still timing problems may occur and the NPC is standing in front of his horse, without mounting it or time displays that it has elapsed ...
Moreover I would like to give the NPC companion a possibility to call his horse. I tried to add some AI package in the GameMode script of the horse, if a certain script variable is set. But it seems, that the horse, if it is out of sight, just doesn't react or evaluate any package (which makes sense, to keep the game performance).
An answer to a special topic then set the RufVernommen variable.
Here is a code summary of the horse
ScriptName CompanionHorse short HeardCall short OnTheWay float OverallDistance short Distance1000 short Distance2000 short Distance3000 short Distance4000 short Distance5000 short Distance10000 short Distance15000 short Distance20000 short Distance25000 short Distance30000 Begin GameMode If ( Distance1000 == 0) Set Distance1000 To 1000 Set Distance2000 To 2000 Set Distance3000 To 3000 Set Distance4000 To 4000 Set Distance5000 To 5000 Set Distance10000 To 10000 Set Distance15000 To 15000 Set Distance20000 To 20000 Set Distance25000 To 25000 Set Distance30000 To 30000 EndIf If HeardCall ; load package to travel to companion If ( GetIsCurrentPackage HorseTravelToCompanion == 0 ) ; remove any currently running package RemoveScriptPackage ; get travel package AddScriptPackage HorseTravelToCompanion EvaluatePackage EndIf Set OverallDistance To GetDistance MyCompanion Message "Fabians Horse has heard the call, it is %.0f away", OverallDistance ; reset vars Set HeardCall To 0 Set OnTheWay To 1 EndIf ; check if we have arrived If OnTheWay If ( GetDistance MyCompanion < 1000 ) Message "Fabians horse is less than %.0f away", Abstand1000 ElseIf ( GetDistance MyCompanion < 2000 ) Message "Fabians horse is less than %.0f away", Abstand2000 ElseIf ( GetDistance MyCompanion < 3000 ) Message "Fabians horse is less than %.0f away", Abstand3000 ElseIf ( GetDistance MyCompanion < 4000 ) Message "Fabians horse is less than %.0f away", Abstand4000 ElseIf ( GetDistance MyCompanion < 5000 ) Message "Fabians horse is less than %.0f away", Abstand5000 ElseIf ( GetDistance MyCompanion < 10000 ) Message "Fabians horse is less than %.0f away", Abstand10000 ElseIf ( GetDistance MyCompanion < 15000 ) Message "Fabians horse is less than %.0f away", Abstand15000 ElseIf ( GetDistance MyCompanion < 20000 ) Message "Fabians horse is less than %.0f away", Abstand20000 ElseIf ( GetDistance MyCompanion < 25000 ) Message "Fabians horse is less than %.0f away", Abstand25000 ElseIf ( GetDistance MyCompanion < 30000 ) Message "Fabians horse is less than %.0f away", Abstand30000 EndIf If ( GetDistance MyCompanion < 350 ) ; close enough to cancel travel package If ( GetIsCurrentPackage HorsePCStay == 0 ) RemoveScriptPackage AddScriptPackage HorsePCStay EndIf ; reset var Set OnTheWay To 0 EndIf EndIf End
AdiBeiElderScrolls 18:16, 7 November 2006 (EST)