argent77 Posted July 18, 2010 Posted July 18, 2010 I’ve been working on a character which acts like an NPC but doesn’t join my party. I’ve used MakeGlobal() to make him persistant. Once he "dies" I move him into an unused area where he waits (deactivated) until summoned again. This works very well until I actually summon him. The action starts with a MoveGlobalObject("A7MYCHAR", Player1) in the baldur.bcs. Which is followed by this code block in the creature script: IF Global("A7MYCHARAPPEARS", "LOCALS", 1) THEN RESPONSE #100 SetGlobal("A7MYCHARAPPEARS", "LOCALS", 0) Activate(Myself) CreateVisualEffectObject("SPPORTAL", Myself) // wrong location! SetSequence(SEQ_AWAKE) END For some reason the visual effect is played at the position of Player1 while the creature is placed next to him. Do you know a way how to fix the location?
Avenger Posted July 19, 2010 Posted July 19, 2010 spportal is an original resource, right? Copy it, and alter the x/y coordinates. Then use that resource.
argent77 Posted July 19, 2010 Author Posted July 19, 2010 Copy it, and alter the x/y coordinates.This approach doesn’t work. It looks like the creature’s coordinates aren’t used when I execute the CreateVisualEffectObject() action. The animation is always centered on Player1 (which I used as target in the MoveGlobalObject() action for the creature), but the creature appears next to Player1 depending on the obstacles which surround him.
devSin Posted July 19, 2010 Posted July 19, 2010 Can you have it MoveToOffset([1.1]) or something so that its coordinates get updated? My guess is that the code to move it so that it doesn't overlap existing objects doesn't actually update its coordinates (CreateVisualEffectObject() is running on the right object, but the object isn't actually where it thinks it is); once it moves (or the player moves), it should suss out its true position.
argent77 Posted July 19, 2010 Author Posted July 19, 2010 Can you have it MoveToOffset([1.1]) or something so that its coordinates get updated?Yes, it works with this action. Thanks! This is the working code (I had to rearrange some lines because the default animation is shown for a split second once the creature is activated): IF Global("A7MYCHARAPPEARS", "LOCALS", 1) THEN RESPONSE #100 SetGlobal("A7MYCHARAPPEARS", "LOCALS", 0) Activate(Myself) SetSequence(SEQ_AWAKE) MoveToOffset([0.0]) CreateVisualEffectObject("SPPORTAL", Myself) Continue() END
Recommended Posts
Archived
This topic is now archived and is closed to further replies.