LukasPJ Posted February 26, 2015 Share Posted February 26, 2015 This is the Impact System from the SpellSystem I created. It's an useful system for, well having an impact on the scene.. Like do something to all enemies in a box, or do something multiple times over a duration. It was created with spells in mind, but can probably be used for other things.There are 5 available impact classes: AOEImpact - Circular impact BoxImpact - What it says on the tin CubeImpact - Likewise ConeImpact - Likewise DOTImpact - Happens x times with [y] milliseconds interval between each impactExamples of use (from my spellsystem examples):%aoe = new ConeImpact(){ SourceObject = %src; Start = %pos; End = VectorAdd(%pos, VectorScale(%eye, 10)); Radius = 2; TypeMask = $TypeMasks::StaticShapeObjectType | $TypeMasks::StaticTSObjectType; CallBack = "ConeCallback"; }; function ConeImpact::ConeCallback(%this, %src, %tgt) { %projectile = ImpactProjectile; ThrowHomingBezierProjectile(%src,%tgt,%projectile,true,"0 0 12"); } %dotimpact = new DOTImpact(){ TickMS = 100; TickCount = 15; CallBack = "FrostBarrageCB"; sourceObject = %spell.getSource(); // Dynamic variables Target = %spell.getTarget(); }; function DOTImpact::FrostBarrageCB(%this, %src) { %weights = GetRandomVector(-3, 3, -3, 3, 0, 3); ThrowHomingBezierProjectile(%src, %this.Target, FrostShardProjectile, true, %weights); } Make these changes to the SceneContainer, and then download the files in: Impacts.zip and add them to the project. Quote Link to comment Share on other sites More sharing options...
Gibby Posted February 28, 2015 Share Posted February 28, 2015 Do I need this to make it work?from ConeImpact: #include "T3D\fx\ImprovedParticle\IPSCore.h" Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted March 1, 2015 Author Share Posted March 1, 2015 Do I need this to make it work?from ConeImpact: #include "T3D\fx\ImprovedParticle\IPSCore.h" I don't think so.. I may have been in a bit of a hurry to get it out there, try deleting that line, it should be okay :P Quote Link to comment Share on other sites More sharing options...
Gibby Posted March 1, 2015 Share Posted March 1, 2015 @Lukas:Tried using your suggestion but Cone, Cube and BoxImpact all have the same error: c:\torque\363_vehiculo\my projects\vehiculo363\source\t3d\impacts\boximpact.cpp(37): error C2039: 'initBoxSearch' : is not a member of 'SceneContainer' 16> c:\torque\363_vehiculo\engine\source\scene\scenecontainer.h(138) : see declaration of 'SceneContainer' Are there other changes I need to make? Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted March 2, 2015 Author Share Posted March 2, 2015 @Gibby did you remember to make these changes? They might be a little hard to notice in the post :) Quote Link to comment Share on other sites More sharing options...
Gibby Posted March 3, 2015 Share Posted March 3, 2015 Ah Snap! I'd commented those changes out troubleshooting and forgot to uncomment them. I got past the previous error, now I get: 16> Creating library ../../../game/Vehiculo363_DEBUG DLL.lib and object ../../../game/Vehiculo363_DEBUG DLL.exp 16>DOTImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::interpolateTick(float)" (?interpolateTick@Impact@@UAEXM@Z) 16>Impact.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall Impact::interpolateTick(float)" (?interpolateTick@Impact@@UAEXM@Z) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::assign(char const *)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z) 16>AOEImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::interpolateTick(float)" (?interpolateTick@Impact@@UAEXM@Z) 16>BoxImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::interpolateTick(float)" (?interpolateTick@Impact@@UAEXM@Z) 16>ConeImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::interpolateTick(float)" (?interpolateTick@Impact@@UAEXM@Z) 16>CubeImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::interpolateTick(float)" (?interpolateTick@Impact@@UAEXM@Z) 16>DOTImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::processTick(void)" (?processTick@Impact@@UAEXXZ) 16>Impact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::processTick(void)" (?processTick@Impact@@UAEXXZ) 16>AOEImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::processTick(void)" (?processTick@Impact@@UAEXXZ) 16>BoxImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::processTick(void)" (?processTick@Impact@@UAEXXZ) 16>ConeImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::processTick(void)" (?processTick@Impact@@UAEXXZ) 16>CubeImpact.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Impact::processTick(void)" (?processTick@Impact@@UAEXXZ) 16>../../../game/Vehiculo363_DEBUG DLL.dll : fatal error LNK1120: 2 unresolved externals AOETmpact didn't have an include for IPScore, so I think I may have a different problem - any ideas? Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted March 4, 2015 Author Share Posted March 4, 2015 @Gibby that seems it's the same issue as with the Tweening.Just change Impact.h line 22-23 to this: virtual void interpolateTick( F32 delta ) {}; virtual void processTick() {}; Quote Link to comment Share on other sites More sharing options...
Gibby Posted March 4, 2015 Share Posted March 4, 2015 @LukasPJ: AHHHH YEAH! Thank you so much for sharing this... Quote Link to comment Share on other sites More sharing options...
Gibby Posted March 5, 2015 Share Posted March 5, 2015 @LukasPJ: 'Nother question: Is it possible to mount an impactCone to an object? i'd like to attach one to a rocket to simulate the thrust exhaust... Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted March 5, 2015 Author Share Posted March 5, 2015 @Gibby such that the exhaust of the rocket deals damage? Quote Link to comment Share on other sites More sharing options...
Gibby Posted March 5, 2015 Share Posted March 5, 2015 @LukasPJ:Exactly!!! :twisted: Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted March 6, 2015 Author Share Posted March 6, 2015 Well for that I'd use a DoTImpact, if you know for how long time the rocket is flying, otherwise just schedule a function that creates a ConeImpact every 200ms or something. Quote Link to comment Share on other sites More sharing options...
Gibby Posted March 6, 2015 Share Posted March 6, 2015 @LukasPJ:Thanks so much! I'll have 'show-off' pics soon! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.