August 17, 2017, 03:40:35 PM

Vita-Nex: Core



ServUO
RunUO

JetBrains

User Info

 
 
Welcome, Guest. Please login or register.

Who's Online

  • Dot Guests: 2
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Advertisment

Current Board

Support  >  General Support

Give and receive help and advice to do with general aspects of project support like installation and configuration. This board is NOT for customisation support!


Author Topic: Effects Help  (Read 7544 times)

0 Members and 1 Guest are viewing this topic.

Offline Sorthious

  • User
  • *
  • Posts: 6
  • Likes: 0
    • View Profile
Effects Help
« on: March 21, 2015, 06:04:40 PM »
I'm new to programming, C#, and scripting.  I learn fairly fast, however, I need help using the effects in script.  Could someone post a simple script of how to call an effect in a script?  Something similar to this but using VitaNex effects:

Code: [Select]
 Effects.SendLocationEffect(m.Location, m.Map, 0x3709, 28, 10, 0x1D3, 5);

I've been searching for examples of how to do the effects but haven't found any....If someone could refer me to examples or post a simple example of the syntax that would be very helpful....Thanks in advance!

Offline Vorspire

  • Administrator
  • *****
  • Posts: 142
  • Likes: 34
  • Founder & Developer
    • View Profile
    • Vita-Nex: Core
Re: Effects Help
« Reply #1 on: March 21, 2015, 10:23:04 PM »
Depending on what you want to do, there is multiple options available, all require this reference:
Code: [Select]
using VitaNex.FX;
and if EffectRender is required:
Code: [Select]
using VitaNex.Network;

To answer your question directly;
Code: [Select]
new EffectInfo( m.Location, m.Map, 0x3709, 0x1D3, 28, 10, EffectRender.SemiTransparent ).Send();

There are pre-defined wave and explosion effects that you can use, which you may have seen in a video or two, or used with the [ExplodeFX and [WaveFX commands; These effects are very easy to write:
Code: [Select]
var effect = new FireExplodeEffect( loc, map, range );

effect.Send();

These are very basic examples, there are many more combinations of arguments and properties to be used, Visual Studio's Intellisense should help you discover these.
« Last Edit: March 21, 2015, 10:25:06 PM by Vorspire »

Offline Sorthious

  • User
  • *
  • Posts: 6
  • Likes: 0
    • View Profile
Re: Effects Help
« Reply #2 on: March 21, 2015, 10:56:33 PM »
You are awesome Vorspire....I really appreciate you taking the time to answer my trivial question.  I am mainly just looking to do things such as adding effects to existing mobiles, items,etc., and possibly enhancing current effects for spells.  This gives me a nice starting point to learn how to script this.  Thank you very much!

Offline Sorthious

  • User
  • *
  • Posts: 6
  • Likes: 0
    • View Profile
Re: Effects Help
« Reply #3 on: March 21, 2015, 11:14:45 PM »
Have VS 2013 Community now...very helpful...was just looking for a starting point....It opens up many options for me!  8)

Offline Abracadabra2.0

  • User
  • *
  • Posts: 3
  • Likes: 0
    • View Profile
Re: Effects Help
« Reply #4 on: December 12, 2016, 10:43:55 PM »
What if I wanted a monster to use one of these visual effects in conjunction with a damage effect. Take Sand Vortex, for example. Its using m.FixedParticles( 0x36B0, 10, 25, 9540, 2413, 0, EffectLayer.Waist ); for the visual.

Offline Vorspire

  • Administrator
  • *****
  • Posts: 142
  • Likes: 34
  • Founder & Developer
    • View Profile
    • Vita-Nex: Core
Re: Effects Help
« Reply #5 on: January 15, 2017, 06:47:33 PM »
What if I wanted a monster to use one of these visual effects in conjunction with a damage effect. Take Sand Vortex, for example. Its using m.FixedParticles( 0x36B0, 10, 25, 9540, 2413, 0, EffectLayer.Waist ); for the visual.

You can construct an EffectInfo object for this purpose, but they use the same methods in the Server.Effects class. The convenience of EffectInfo is that you can re-use it multiple times by calling Send() successively.

When it comes to using the explosion effects for dealing damage, it is recommended to provide an effect handler method to be called on each effect in the explosion's queue.

Code: [Select]
var fx = new FireExplodeEffect(target, target.Map, ExplosionRange)
{
EffectHandler = e =>
{
// Don't repeat damage for multiple effects on the same tile
if (e.ProcessIndex != 0)
{
ExplosionDamage(e);
}
}
};

fx.Send();
Code: [Select]
public virtual void ExplosionDamage(EffectInfo info)
{
Effects.PlaySound(info.Source.Location, info.Map, ImpactSound);

foreach (var m in
info.Source.Location.GetMobilesInRange(info.Map, 0)
.Where(m => m != null && !m.Deleted && User.CanBeHarmful(m, false, true)))
{
m.Damage(Utility.RandomMinMax(DamageMin, DamageMax), User, true);
}
}

This code can be found in the ThrowableBomb code in Vita-Nex.

 

Download VNc

Recent Topics

Vita-Nex: Core 4.0.0.0 Released by Vorspire
[January 15, 2017, 08:56:41 PM]


Effects Help by Vorspire
[January 15, 2017, 06:47:33 PM]


Ultima Online Phoenix is Ready to Begin! by Abracadabra2.0
[December 13, 2016, 01:14:49 AM]


How To: Deceit Braziers Spawn/Despawn by Abracadabra2.0
[November 26, 2016, 07:34:13 PM]


Installing VNC 3.0.0.1 by Johnny
[August 27, 2016, 06:49:40 PM]


JSON Web Stats Stuck Problem by Argalep
[May 27, 2016, 06:16:55 AM]


Modules not Working after being Enabled by ProfessorChaos
[May 19, 2016, 02:44:06 AM]


Issues Installing VitaNex Core 3.0.0.1 on RunUO 2.7 by ProfessorChaos
[May 18, 2016, 09:30:37 PM]


ADM Assistance by Vorspire
[May 18, 2016, 09:23:25 PM]


Suggestion by Vorspire
[April 24, 2016, 06:23:15 PM]

Comments

Refresh History
  • Moderated
  • cmileto: pls delete my comment
    June 08, 2017, 01:03:35 AM
  • cmileto: ServUO - [https://www.servuo.com] Version 0.5, Build 6363.36277 Core: Optimizing for 4 64-bit processors RandomImpl: CSPRandom (Software) Core: Loading config... Scripts: Compiling C# scripts...Failed with: 1 errors, 1 warnings Warnings:  + Clayton/WorldOmniporter/WorldOmniporter.cs:     CS0162: Line 324: Unreachable code detected     CS0168: Line 957: The variable 'e' is declared but never used Errors:  + Clayton/Vita/Mobiles/Vendors/Advanced/AdvancedVendor.cs:     CS1501: Line 530: No overload for method 'GetSellPriceFor' takes 1 arguments     CS1501: Line 634: No overload for method 'GetBuyPriceFor' takes 1 arguments     CS1501: Line 1127: No overload for method 'GetSellPriceFor' takes 1 arguments Scripts: One or more scripts failed to compile or no script files were found.  - Press return to exit, or R to try again.
    June 04, 2017, 05:37:10 AM
  • Terrapin: Hello - and thanks - thought I would check VNC out since using it in JustUO server...
    April 22, 2015, 10:20:17 PM
  • Vorspire: Hello!
    December 16, 2014, 07:11:55 PM
  • Tek: Hello
    December 15, 2014, 08:51:25 AM
  • magnus_mythos: hello
    November 18, 2014, 05:30:22 AM
  • Antares_UO: thanks Vospire
    June 15, 2014, 06:52:17 PM
  • jezika: Thank you is not enough Vorspire! This system is exactly what I was looking for.
    June 04, 2014, 06:01:11 AM
  • Vorspire: VNc 2.1.1.0 Released!
    March 10, 2014, 01:33:06 AM
  • Vorspire: VNc 2.1.0.0 Released!
    January 27, 2014, 12:57:51 PM
  • Kassandra: Many thanks for building my shard for me.  It is awesome, I'm extremely pleased with what you've done and the ongoing support!!!
    November 20, 2013, 01:31:08 AM
  • Regnak: Great news ! Thanks Vorspire :)
    November 16, 2013, 01:55:16 PM
  • Vorspire: VNc: 2.1.0.0 is being developed!
    November 13, 2013, 08:38:35 AM
  • Vorspire: VNc 2.0.0.5 Released!
    September 11, 2013, 12:49:42 AM
  • Vorspire: VNc 2.0.0.4 Released!
    August 23, 2013, 12:47:54 AM
  • Vorspire: VNc 2.0.0.3 Released!
    July 05, 2013, 12:50:13 AM
  • Kaemalux: :-)
    July 01, 2013, 01:51:13 PM
  • Vorspire: VNc 2.0.0.2 Released!
    June 20, 2013, 08:29:19 PM
  • scrlked: I am trying it out on my shard. This is taking UO to the next level.
    June 13, 2013, 11:11:16 AM
  • Vorspire: VNc 2.0.0.0 Released!
    June 03, 2013, 12:53:33 AM

Carbonate design by Bloc
variant: carbon
SMF 2.0.11 | SMF © 2015, Simple Machines
SimplePortal 2.3.6 © 2008-2014, SimplePortal