• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Idea] [system] (vJass) CustomMissle

Status
Not open for further replies.
Hmm, methinks setTargetPos/Z is broken -- try this code:
JASS:
//! 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

The missile seems to think it has landed at its target the instant the target it set...
 
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.
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.
Just saying ...

In THW community project, if coders use this (they will) they will most likely have to repeat chunks of code for simple tasks. You can see why this is bad right?
Besides, afaik, ARGB allows you more flexibility on changing colors, fades and gradients - it can't get any easier.

Just a suggestion.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Flame_Phoenix said:
Why not use ARGB to change the color of the missile ?

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).

To be quite frank, this is a dumb suggestion, even though Anachron is being nice about it. If code was posted, I could show you exactly how this would be done.

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.

I don't understand where all of this poor criticism comes from, either, you're just wasting Anachron's time with these pointless suggestions.
 
Level 12
Joined
May 21, 2009
Messages
994
Sorry for my late respone, Anachron I like your project because of it's flexability. Your systems can be used for very simple stuff, but also advanced stuff. Also you seem to be very motivated and you seem to be working on it often. Nice job.
 
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).
It's not about variables, it's about modularity and extra functionality.

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.
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...

Why do I make my suggestions? Because I am trying to add the "wc3c elitism" into this code. I have a fussy feeling that Anachron will, eventually, submit this to wc3c.net and we both know that without using their approved systems / libs this will be rejected, at the best (lets hope Griffen doesn't show up saying that this is an example on "how not to code").
You obviously have no idea on what elitism is, so stick to your reviews and let the others do their own.

Keep in mind I never said the code was bad or sucked balls. I am just being the regular asshole from wc3c.net saying that you need to use their stuff. Someone has to do it.
 
Flame_Phoenix you should check about the CustomFilter thing that I've posted on wc3c.net.
I noticed that I am not welcome on wc3c because I am not good enough at english and I can't really point out the pros for my systems, so I will stick around here.

Also, the ARGB would only save my oneliner anyway, so it's to much code to be useful.
(I currently have this:
JASS:
call cmd.colorARGB(a, r, g, b)
)
 
You do realize that ARGB doesn't only allow you to change colors right?

JASS:
//******************************************************************************
//*
//* 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.
//*
//********************************************************************************

//=================================================================================

System:
http://www.wc3c.net/showthread.php?t=101858&highlight=ARGB

It was just a suggestion. If you don't think it is necessary, you don't need to add it.
 
read the part where it says that you will use it to slow the missile ?
That is exactly my problem Anachron. It is common knowledge that "getter methods" should NOT affect the object itself. If you want to alter an object than you should create a "setter method" and not a getter. It is a programming principle used in all object oriented languages. I strongly recommend that you change that method.

And please, keep in mind that I always read stuff before posting about them. There is no need to get touchy xD
 
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.)
Why not create the missile already instead of morphing a unit into one?
What exactly do you want to do?
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 you :p
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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.
 
Why not create the missile already instead of morphing a unit into one?
Maybe he's trying to do the Morphlings spell of dota.

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.

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.
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.

By 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.
 
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.
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.

By 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
Than I will gladly wait for your next thread update in order to criticise it :p
 
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.
But that is impossible (at least with my system). It's not thought to process a jump or such.

And about the other way: I have not changed anything.
I like it the way it is.

There is NO other way to effectively change the missiles speed temporary without forcing the unit to reset the missilespeed.
 
Anachron, if I were a moderator I wouldn't approve your system.
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.

Making a jump is just like making a grenade spell (which I assume you can make). It shouldn't be any different.
Anyway, I won't blame you for not implementing such a feature, as I find it quite silly myself.
There is NO other way to effectively change the missiles speed temporary without forcing the unit to reset the missilespeed.
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.
And you say this is better than xe? Am I missing something?
Yes, you miss the point that xe does also not provide that feature.

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.
Wrong, it gets the temporary speed of the missile, that is the only reason. It never sets anything with the return value.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Sorry if my question was confusing. (I should have phrased it so that I asked "Can the system treat a unit like a missile?")

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, like hurling them at someplace or using the model of the spell target unit as a missile.

It's not important to do it. =P
 
No it doesn't since I use a specific unit type to be missile so I use some enhancements that would not possible with regular units.

I will never implement this feature since it's an unit, not a missile.
You can still recreate the whole thing by adding the model of the unit to the missile and throw that missile to somewhere.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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

If you take a look at this you can see that you can create projectiles using any unit to leave the door open as to what can be launched as a projectile.

I'll stop "hijacking" I feel like a cry-baby.
 
Status
Not open for further replies.
Top