Noober1 Posted January 11, 2021 Author Share Posted January 11, 2021 Yes it just drops to the ground lol. Argh! Link to comment Share on other sites More sharing options...
Noober1 Posted January 11, 2021 Author Share Posted January 11, 2021 Yea it just drops to the floor lol. Did some digging around and was reading about SetMotionType with the type set to 4 which says the object will nto be simulated by havok.Could that work and if so would that script be on the magic effect or the actor? Link to comment Share on other sites More sharing options...
dylbill Posted January 11, 2021 Share Posted January 11, 2021 Maybe you can just use the actual trap bow then, instead of making it an actor. You can duplicate it and make your script extend ObjectReference again: Activator Property WHA_Sentry Auto Float Property Distance = 100.0 Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ObjectReference WHA_SentryRef = akCaster.PlaceAtMe(WHA_Sentry, 1, 0, 1) ;place one sentry at caster ;(WHA_SentryRef as TWHA_SentryCombatScript).Owner = akCaster ;Set owner of sentry to the caster. Float A = akCaster.GetAngleZ() Float XDist = Math.Sin(A) Float YDist = math.Cos(A) YDist *= Distance XDist *= Distance WHA_SentryRef.MoveTo(akCaster, XDist, YDist, 50, True) WHA_SentryRef.Enable() EndEvent Link to comment Share on other sites More sharing options...
Noober1 Posted January 11, 2021 Author Share Posted January 11, 2021 Been messing around with it for a while now and for some reason after swapping it from an Actor to an Activator, both scripts compile but in game, the Sentry never spawns. I've made sure to update my properties afterwards as well. This is the script that is currently on the trap activator Scriptname WHA_SentryCombatScript extends ObjectReference import UtilityActor Property PlayerREF AutoFloat Property xOffset Auto Float Property yOffset Auto Float Property zOffset AutoFloat Property RandomOffsetX AutoFloat Property RandomOffsetY Auto Float Property RandomOffsetZ Auto Float Property PulseRate = 1.0 Auto Float Property RandomRate Auto Activator Property TargetType Auto ObjectReference Property CurrentTarget AutoBool Property SpawnNode Auto Spell Property WHA_SentryFirebolt Auto FormList Property TargetTypeList AutoFloat Property SeekRange = 1000.0 Auto Actor Property Owner Auto Hidden ;the actor that spawned this sentryFloat InitTime Event OnInit() InitTime = Game.GetRealHoursPassed() RegisterForSingleUpdate(PulseRate)EndEvent Event OnUpdate() Actor Target = Game.FindRandomActorFromRef(Self, SeekRange) if Target If Target.IsHostileToActor(Owner) ;only cast spell if hostile to owner. WHA_SentryFirebolt.Cast(Self,Target) Endif endif If ((Game.GetRealHoursPassed() - InitTime) > 0.016) || Self.IsDisabled() ==false Self.Disable() Self.Delete() Else RegisterForSingleUpdate(PulseRate + RandomFloat(0.0, RandomRate)) Endif EndEvent Link to comment Share on other sites More sharing options...
Noober1 Posted January 11, 2021 Author Share Posted January 11, 2021 Nevermind I fixed that. Turns out there was a property mix up on the magic effect. So the sentry now spawns, then crashes the game lol. I may be at my wits end here. I seriously appreciate all the help you've given me. Link to comment Share on other sites More sharing options...
dylbill Posted January 11, 2021 Share Posted January 11, 2021 No problem, that's strange that it causes CTD. Did you try testing on a new game? Link to comment Share on other sites More sharing options...
Noober1 Posted January 11, 2021 Author Share Posted January 11, 2021 I fixed it!! In addition....I got it to fire the spell straight out instead of coming from below ground. I switched it back to Actor, readjusted the scripts/properties then tinkered around in the Race menu. Under General Data, one of the tick boxes, "Uses Head Track Anims" had to be ticked. So now the actor is spawned, turns toward any hostile enemy nearby, pelts them with firebolts and disappears after 60s. That is EXACTLY how I wanted this to turn out. Link to comment Share on other sites More sharing options...
dylbill Posted January 11, 2021 Share Posted January 11, 2021 Awesome, glad you got it working! Link to comment Share on other sites More sharing options...
Recommended Posts