Voilà, en rentrant ce soir, j'ai eu envie de créer un nouveau sort débile : une pluie de flèches... l'idée est toute simple, on crée un grand nombre de flèches et on les envoie toutes en même temps...
après avoir réfléchi, j'ai fini par décider de les envoyer une par une avec le script que voici :
Scriptname AuArrowShowerEffectScript extends activemagiceffect Actor Property PlayerRef Auto Ammo Property boundArrow Auto EVENT onEffectStart(ACTOR akTarget, ACTOR akCaster) int conjuValue = (akCaster.GetActorValue("Conjuration") as int) int nbArrows = conjuValue / 6 float AngleX = akCaster.GetAngleX() float AngleY = akCaster.GetAngleY() float AngleZ = akCaster.GetAngleZ() float AxeX = math.cos(AngleY) * math.sin(AngleZ) float AxeY = math.cos(AngleY) * math.cos(AngleZ) float AxeZ = math.sin(AngleX) * (-1) ObjectReference MyArrowInYourKnee while (nbArrows > 0) MyArrowInYourKnee = akCaster.PlaceAtMe(boundArrow,1,false,true) ;MyArrowInYourKnee.MoveTo(akCaster, (AxeX*128)+Utility.RandomInt(-25,25), (AxeY*128)+Utility.RandomInt(-25,25), (PlayerRef.GetHeight()/2)+Utility.RandomInt(-25,25)) MyArrowInYourKnee.setPosition(akCaster.GetPositionX()+(AxeX*128)+Utility.RandomInt(-25,25), akCaster.GetPositionY()+(AxeY*128)+Utility.RandomInt(-25,25), akCaster.GetPositionZ()+(AxeZ*128)+Utility.RandomInt(-25,25)) Utility.wait(0.1) MyArrowInYourKnee.enable() MyArrowInYourKnee.ApplyHavokImpulse(AxeX, AxeY, AxeZ, (conjuValue*1000)) nbArrows -= 1 endWhile endEVENTHélas, la ligne
MyArrowInYourKnee.ApplyHavokImpulse(AxeX, AxeY, AxeZ, (conjuValue*1000))ne fonctionne pas du tout puisque mes flèches tombent mollement sur le sol à mes pieds...
Ayant repris un petit bout de script ici, je me disais que je devais certainement faire quelque-chose de travers avec ApplyHavokImpulse puisque ce script :
Scriptname AuPVScript extends ActiveMagicEffect EVENT onEffectStart(ACTOR akTarget, ACTOR akCaster) float TargetMass = akTarget.GetActorValue("Mass") akCaster.PushActorAway(akTarget, 0) akTarget.ApplyHavokImpulse(0.0, 0.0, 1.0, (TargetMass)*(TargetMass)*(TargetMass)*4000+1000 ) Utility.Wait(1) akTarget.ApplyHavokImpulse(0.0, 0.0, 1.0, ((TargetMass)*(TargetMass)*(TargetMass)*4000+1000)*-1 ) endEVENTqui l'utilise également fonctionne parfaitement...
Des idées, vous voyez un truc qui m'aurait échappé ?... une recette de tarte au fromage ?
Modifié par Aurix, 28 mai 2013 - 02:21.