Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Problem With Force Push Effect

Page: 1 of 1
 Exile007
12-06-2008, 11:24 PM
#1
Hey sorry to bother you guys so soon again but I have another rather strange problem. I've scripted it so that when this script fires, a Sith is supposed to be blown backward. The problem is, the Sith does indeed get up in the air like she's supposed to during the effect, but she doesn't exactly move anywhere.

void main(){

object oSith=GetObjectByTag("sith_lord", 0);
location lPush=GetLocation(GetObjectByTag("wp_push"));
//"wp_push" is a good ten meters behind the sith lord
effect efPush = EffectForcePushTargeted(lPush);
efPush = EffectLinkEffects(efPush, EffectVisualEffect(1014));
ApplyEffectToObject(1, efPush, oSith, 2.0);

}

I have a feeling that the effect error is in the location area but I have no idea.

I checked the M4-78 source scripts, particulary the one in the Sion Vs. Nihilus mini-scene (where Nihilus blows Sion back). It seemed to work there, but not here...

If anyone could point out something wrong with the script or suggest a new method of reaching this effect I'd appreciate it. :)
 Star Admiral
12-07-2008, 12:50 AM
#2
void main() {

object oSith = GetObjectByTag( "sith_lord", 0 );
location lPush = GetLocation( GetObjectByTag( "wp_push" ) );

SignalEvent( oSith, EventSpellCastAt( OBJECT_SELF, 23, 1 ) );

effect eLink1 = EffectForcePushTargeted( lPush );
eLink1 = EffectLinkEffects( eLink1, EffectVisualEffect( VFX_IMP_FORCE_PUSH ) );

ApplyEffectToObject( DURATION_TYPE_INSTANT, eLink1, oSith, 2.0 );

}

Not a coding expert, but try this variant. Pretty much the only thing that was added is the SignalEvent, the rest is just replacing some of the numbers by constants.

- Star Admiral
 Exile007
12-07-2008, 7:58 PM
#3
Nope, that didn't work. :P

I was wondering if the problem could have something to do with the area I'm using? I used the exact same script on a Ravager module to see something, and to my amazement, the script worked and the NPC was blown backward. But when I use it in the Korriban academy, it doesn't work. The NPC just falls down, but doesn't fly back.

I'm fresh out of ideas. :(
 Star Admiral
12-07-2008, 8:10 PM
#4
Are you sure that the location specified in lPush is a valid location that is unblocked by any object? I checked the function in nwscript, and it suggests that if there isn't a direct clear line to that location, the push might not work.

Try changing

effect eLink1 = EffectForcePushTargeted( lPush );

to

effect eLink1 = EffectForcePushTargeted( lPush, 0 );

That will override the geometry checks for force pushes, so that the object that the effect is applied to is guaranteed to move that far, ignoring collisions.

- Star Admiral
 Exile007
12-11-2008, 6:10 PM
#5
Whoops, apparently the area model I was using was 'bugged'. So the pathway was blocked, it works now, thanks! :)
Page: 1 of 1