- Joined
- May 4, 2007
- Messages
- 2,260
Why not use ARGB to change the color of the missile ?
Is it ugly too?
Is it ugly too?
//! zinc
library Test
{
boolean done = false;
struct TestMissile extends CustomMissile
{
method onCreate ()
{
sfx = "Abilities\\Spells\\Undead\\OrbOfDeath\\AnnihilationMissile.mdl";
scale = .55; //: 55% of the normal size
colorA = 128; //: Half transparent
movespeed = 128.; //: Moves with a rate of 512
turnspeed = 0.15; //: Turns with a rate of 0.15
hitrange = 48.; //: Hits units and missles in range of 48.
//set .xyarc = -0.15 //: Has an xyArc of -0.15
height = 50.; //: Has a height of 50.
hitwalls = false; //: Hits walls
hitdests = false; //: Hits destructalbes (kills them)
hitunits = true; //: Hits units
hitmissiles = false;//: Hits missles
}
method onTargetReach ()
{
TestMissile m;
done = !done;
if (done)
{
m = TestMissile.create(1000., 0., GetLocZ(1000., 0.) + 50., 0.);
m.setTargetPosZ(0., 0., GetLocZ(0., 0.) + 50.);
}
else
{
m = TestMissile.create(0., 0., GetLocZ(0., 0.) + 50., 0.);
m.setTargetPosZ(1000., 0., GetLocZ(1000., 0.) + 50.);
}
}
method onLoop ()
{
}
method onDestroy ()
{
}
static method onInit ()
{
integer i;
TestMissile m;
//for (i = 4; 4 >= i >= 0; i -= 1)
//{
m = TestMissile.create(0., 0., GetLocZ(0., 0.) + 50., 0.);
m.setTargetPos(1000., 0.);
//}
FogEnable(false);
FogMaskEnable(false);
}
}
}
//! endzinc
You mean, the idea is to make not modular an inflexible ? Because if you are not aiming for modularity, than I assure you the last thing that is going to be is flexible.Flame_Phoenix the idea was to make it fast & flexibel without tons of librarys needed. That's one of the reasons I removed my CustomFIlter system from it.
I had something running onDestroy, but I removed it. I kept the method there so if I needed it again I didn't have to type it out again.Why do you overwrite the onDestroy method?
Flame_Phoenix said:Why not use ARGB to change the color of the missile ?
It's not about variables, it's about modularity and extra functionality.The color of the missile can be changed by referencing the unit that represents the "missile", in which you can change the color yourself using ARGB. There is no point in him including that system (even optionally) just to save you one variable reference (which would be referenced anyways in the system).
I dunno where you learned how to code but having repeated chunks of code all over the map doesn't seem much "flexible" to me...Its funny though how you're saying that because its not modular its not flexible, and then you go ahead and tell him to add an optional library for specific functionality. Flexibility comes from the open-ended orientation of your code, to which (nearly) countless features can be added after without changing the way the system works.
call cmd.colorARGB(a, r, g, b)
Anachron (Profile) said:You know i am so shy.
//******************************************************************************
//*
//* ARGB 1.2
//* ====
//* For your color needs.
//*
//* An ARGB object is a by-value struct, this means that assigning copies the
//* contents of the struct and that you don't have to use .destroy(), the
//* downside is that you cannot assign its members (can't do set c.r= 123 )
//*
//* This library should have plenty of uses, for example, if your spell involves
//* some unit recoloring you can allow users to input the color in the config
//* section as 0xAARRGGBB and you can then use this to decode that stuff.
//*
//* You can also easily merge two colors and make fading effects using ARGB.mix
//*
//* There's ARGB.fromPlayer which gets an ARGB object containing the player's
//* color. Then you can use the previous utilities on it.
//*
//* The .str() instance method can recolor a string, and the recolorUnit method
//* will apply the ARGB on a unit
//*
//* For other uses, you can use the .red, .green, .blue and .alpha members to get
//* an ARGB object's color value (from 0 to 255).
//*
//* structs that have a recolor method that takes red,green,blue and alpha as 0.255
//* integers can implement the ARGBrecolor module to gain an ability to quickly
//* recolor using an ARGB object.
//*
//********************************************************************************
//=================================================================================
Good decision.I may add it optionally, it will never be a requirement.
Why not create the missile already instead of morphing a unit into one?Is there a way to make a unit into missile? It's not completely needed for this system, though it does make it nicer if it can do this. (Sorry if there is and I didn't see it.)
I want you to fix getMissileSpeed and to be congruent. And yes, I know this was not directed to me, but I couldn't help myself reminding youWhat exactly do you want to do?
Maybe he's trying to do the Morphlings spell of dota.Why not create the missile already instead of morphing a unit into one?
Hmm maybe because you don't tell people to check the thread? Also, this is in Trigger&Scripts, yours is in the Jass section. That is about 1/20 activity.I don't see how this thread is getting so much damn activity while my actual submission has gotten absolutely no feedback. Maybe I should take it down from the submissions here and post it up at wc3c.
Perhaps transforming a unit into a missile can be a good idea for spell like "jumps" and such.And no it isn't, it's easier (& better) to just create a missile for the replacement.
Missiles are units of a specific type and have specific attributes.
Than I will gladly wait for your next thread update in order to criticise itBy the way, phoenix, I already have a setter method. This getter method is just to get unregular, onetime or shorttime missle speed without having to change it back again
But that is impossible (at least with my system). It's not thought to process a jump or such.Perhaps transforming a unit into a missile can be a good idea for spell like "jumps" and such.
I don't see other use for it.
And you say this is better than xe? Am I missing something?There is NO other way to effectively change the missiles speed temporary without forcing the unit to reset the missilespeed.
Yes, you miss the point that xe does also not provide that feature.And you say this is better than xe? Am I missing something?There is NO other way to effectively change the missiles speed temporary without forcing the unit to reset the missilespeed.
Wrong, it gets the temporary speed of the missile, that is the only reason. It never sets anything with the return value.At least change the name of the method, since it will not be used to "get" the speed of the missile but to "set" it instead.
watermelon_1234 said:The reason for doing it would be similar to Flame_Phoenix's example: it could be usable for jumping spells or spells that want to use units as a missile