clockout1 Posted February 1, 2010 Share Posted February 1, 2010 I am trying to make a script that forces a skeleton to walk to a marker when the player enters a trigger zone. Scn BlademasterGlimpse short triggered Begin Gamemode if triggered == 0 GBlademaster.SetActorsAI 0 endif if triggered == 1 GBlademaster.Enable GBlademaster.SetActorsAI 1 endifend The creature has an ai package telling it to move to that marker (set as specific target, find package). The duration is 100. Instead, the skeleton just stands there. Link to comment Share on other sites More sharing options...
Argomirr Posted February 1, 2010 Share Posted February 1, 2010 I can spot a few errors in your script, but you're taking a rather unusual approach by disabling the actors AI, then enabling it. ;D Since the actors AI isn't processed when it's disabled, it isn't necessary to do this. You can simply set the creature initially disabled, give it a unique reference ID and change the reference in this script to that:Scn BlademasterGlimpse Short DoOnce Begin OnTrigger Player If DoOnce == 0 [INSERT REF].Enable [INSERT REF].EvaluatePackage Set DoOnce to 1 EndIf EndThe OnTrigger block normally runs when something enter the trig zone, but by adding "Player" to it, it will only run if triggered by the player. The DoOnce variable makes sure this only runs once. The EvaluatePackage call makes sure the actor will update its package immediately, otherwise it'd just be standing there until the game decides to update them. Also, setting the packages duration to 100 isn't necessary, just leave it at 0. (Might not work as you expected otherwise.) I'll also point out some errors in your script: :) Scn BlademasterGlimpse short triggered Begin Gamemode <- Wrong block type, if you're attaching this to a trig zone, you should use an OnTrigger (or similar) blockif triggered == 0GBlademaster.SetActorsAI 0<- You forgot to set the triggered variable to 1.endifif triggered == 1 <- Therefore, this statement will never be true, so the stuff under it won't run.GBlademaster.EnableGBlademaster.SetActorsAI 1endifend I hope this helped. :thumbsup: Link to comment Share on other sites More sharing options...
clockout1 Posted February 1, 2010 Author Share Posted February 1, 2010 It helped a lot. Is it ok if I just pm you from now on instead of cluttering the forums? Link to comment Share on other sites More sharing options...
Argomirr Posted February 1, 2010 Share Posted February 1, 2010 If you want a quick reply, it might be best to post a topic; there are many people around here that can help. :) But feel free to PM me if you need. I may not always respond as quickly though. :P Link to comment Share on other sites More sharing options...
Recommended Posts