Jump to content

Even More Scripting Trouble


clockout1

Recommended Posts

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

endif

end

 

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

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

End

The 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) block

if triggered == 0

GBlademaster.SetActorsAI 0

<- You forgot to set the triggered variable to 1.

endif

if triggered == 1 <- Therefore, this statement will never be true, so the stuff under it won't run.

GBlademaster.Enable

GBlademaster.SetActorsAI 1

endif

end

 

I hope this helped. :thumbsup:

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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