1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Producer Update: Natives List

Discussion in 'Patch & Reforged Discussion' started by Kam, Dec 7, 2017.

  1. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Nice, that's a whole lot better than piecing together individual patch notes like I suggested, unless you need more info than a signature. Do you know of any plans to make a more usable (organized and/or descriptive) documentation for the latest API?
     
  2. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    I was really excited to read about the implementation of Proxies (spell casting dummies), customisable missiles, bars, detecting when a unit releases an attack... but then to learn those functions don't even exist in my common.j or blizzard.j files yet was a huge letdown.
     
  3. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Some of that is fine then, because the need was filled using a different name / implementation than the original plan, and you just aren't looking for the right thing.

    Using a WC3 spell as the base for additional custom spells has been deprecated in favor of directly manipulating the visual effects that compose it. For example, if I wanted a unit to cast a custom spell then I would give the appropriate unit a placeholder ability and listen to when it was activated. The placeholder ability would do nothing beyond be castable and have a mana cost, all the real work would happen in the event listener for it being cast. The beauty of this is that I can easily remove the unit / placeholder ability and still have my custom spell (and it can be cast without a unit/dummy source)

    I'm not sure what you mean by "customisable missiles", but I'm pretty sure you could achieve this using any number of methods. Could you elaborate on what you're thinking of?

    I think in game "bars" have either been released or are still on the menu for near future

    Detecting when a unit releases an attack would be a nice event to have for a few very specific needs, but I don't know that its generally useful enough to merit its existence/cost. Anyways, for your needs, are you going to fire that "on attack released" event a lot? If its infrequently, then it might be best for you to implement your own order system on top of the vanilla WC3 system. You'd obviously be able to control your system's design, and could easily add in an OnAttackReleased Event
     
  4. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    Really not sure what you're talking about.

    I'm talking about the list of natives on the First Post of this Thread (by Kam).

    There's custom missile native functions, proxies, bars, detecting when a unit releases an attack etc... they're all listed there. But NONE of them are in the current game, common.j, blizzard.j or anything. That's why I'm confused... why is a Blizzard employee just listing random natives that do or don't exist? That's why I was asking for clarification.

    Yes I know you can do dummy spells in other ways, but it's cumbersome and forces you to create dummy units (that take up unnecessary memory) and move them around. The natives listed on the first post of this thread mention that it can be done so much better:
    Not to mention that this proposed method also links the source of the caster, which is not currently possible right now.

    As for the missiles, again, read the original post:
    Of course you can do custom missiles by coding in your own logic for movement, arcs etc, but this native support makes it a million times easier.
     
    Last edited: Jul 30, 2019
  5. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,298
    Resources:
    16
    Tools:
    2
    Maps:
    2
    Spells:
    7
    Tutorials:
    4
    JASS:
    1
    Resources:
    16
    It is kind of a wish/request list.
     
  6. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    Finally someone answered the question!
    So basically, they're not in the game yet, but what people want to be added.

    Shouldn't the first post be edited to say this a bit more clearly? Googling "Wacraft 3 new natives list" brings you here, and is kinda misleading.
     
  7. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    doing it "other ways" should take less memory, not more. my point was that you are no longer forced to create dummy units because of the new natives. i doubt anyone will use dummy casters again by choice for custom spells. the proxy API may eventually appear if there is enough need to support dynamic casts of existing vanilla spells. i wouldn't count on it, given an alternative has been supplied

    i think this has been said a few times now, though maybe in slightly less obvious terms
     
    Last edited: Jul 30, 2019
  8. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    Considering that the first reply to my question said "All of them were added long ago" (which is completely false), the second and third responses can be surmised as "Some of them, but not all of them and some will be removed or not exist in the future" followed by a slew of unrelated comments, I hope you can see why I was confused.

    One question I do still have though - how exactly could you link the source of a spell to the caster? As an example, if I wanted a unit to cast a modified Shockwave to fire 5 small shockwaves in a cone - how do you link the damage of each of the smaller shockwaves to the original caster? This doesn't seem to be possible with the "AddSpellEffect" natives. You could cast a shockwave from the correct points, but how you do know which unit owned the cast? You can't correctly determine the killer if the shockwaves kills in this case.

    This is why I thought the proxy method listed in Kam's post was superior. You just cast 5 different shockwaves offset by angles, with the source set to the original caster. Done.
     
  9. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Think of WC3's implementation of spells as having a unit source, a condition to activate, and a functional effect. The source is always a unit, the condition is usually some check on the source and/or target, and the functional effect is any code. WC3 functional effects often involve an area/target, visual effects, sound effects, state changes, sometimes instant, sometimes over a set period of time. The first and second part of this design might seem intuitive for the melee/vanilla component of the game, but it leads to awkward situations in custom maps where you need to create a proxy caster just to get to the functional effect of a spell, when, really, that last piece was all you ever wanted. If we just focus on the last part of the spell design, the spell having an effect, we can now fully achieve that using the new & existing natives, without having to rely at all on a vanilla spell object. Part of the beauty of the new special effect API is it gives you smaller pieces to work with, which can still be connected to conventional WC3 spells (cast by a unit via an ability)

    For your specific question, you'd want to keep references to both the unit caster of the spell and the special effects/locations representing each shockwave. Then you'd update those references over time, both to visually display the spell and apply damage from the appropriate source (the original caster). You could connect this code by listening for vanilla unit spell/ability casts via
    call TriggerRegisterAnyUnitEventBJ(YourSpellTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    and then, in the event callback, check
    GetSpellAbilityId()
    returned the same raw object ID as your placeholder spell/ability (raw ID code can be found in the object editor)

    I'm in agreement with you, I think that the Proxy API supports dynamic casts of existing vanilla spells. Currently, your plan to just cast 5 vanilla shockwaves with slight configuration changes to each is a great fit for the Proxy API

    However, as soon as you want to go beyond what any given spell allows you to configure, you'll be much better off dealing with the new special effect API. My point is that each API has its own use cases, but you could still get your custom shockwave with just a bit more lifting than your original Proxy based design
     
  10. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    This is what I meant. It's way more code to write your own projectiles, track their locations, update them every game tick, control who was hit by what etc. when that code all already exists in the game in the form of the base Shockwave skill.

    Now if those natives listed under "Missiles" in Kam's post are added, that already goes a very long way to smoothing out that coding requirement. It will give trackable missiles, so all the movement, locations and trajectories are done already and you have to do the other parts manually.

    So what I wonder is, is the current Spell Effect API capable of doing say a Shockwave that applies Curse (and its debuff) to hit targets? I bet you can't without having something cast a curse on the unit.
     
    Last edited: Aug 1, 2019
  11. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    First off, you're being a little dramatic, it's like maybe 3-4 lines of JASS code to move a point over time in a straight line, and reposition the special effect on that point. Add another 6 lines for damaging everything in a radius around the point each tick. You could literally be done with the entire thing by the time we've had this full conversation, even if you had to look up how to use sin and cos to do it
    Secondly, part of the point of moving away from vanilla spells/abilities is that you literally cannot directly access their implementation as JASS -- you can only access them via issuing a unit order. So when you say "that code all already exists in the game in the form of the base Shockwave skill", i say it might as well not exist at all for most purposes

    The special effect API isn't driving anything beyond the visual component of the spell. Whatever is calling the special effect API is also applying the damage to hit targets, and just as easily apply curse to hit targets. So yes, you're mostly right
    You'd also get to choose not to apply the terrain deformation, which leaks every iteration. This might be a really nice choice, if your map has a long average play time / many custom shockwave casts

    EDIT - Actually, I do get not wanting to make your own projectile-like implementation with one from blizzard probably on its way. I guess my recommendation then is to just wait and see, at least till reforged comes out or you get too bored
     
    Last edited: Aug 1, 2019
  12. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    I wouldn't say it was just a handful of lines - you'd need to make it MUI for a start, and keep track of targets already hit. Anyway, it's besides the point - the point being that the proxy system would achieve this in less than 10% of what's needed in the other method.

    I also want to make it clear that I'm not talking about Special Effects - I know what they are and how to do them - I'm referring not to the visual, sound or whatever component of the spell. I'm specifically referring to editing what the spell DOES. Would it be possible to "cast" a customized curse (with my own choice of percentage chance to miss) on a unit of my choosing without creating a dummy unit to cast it, and without creating the spell inside the object editor first? Would the debuff show up on the unit (again, customized debuff of my choosing) affected and correctly cause the unit to miss attacks, be dispellable etc.? - like a normal game Curse cast by the Banshee unit but with edited text or percentage chances.

    As far as I know, you can't apply a buff (or debuff) to a target without the spell actually being cast somehow (or giving the unit a self-affecting aura, but that wouldn't be dispellable). But you said "and just as easily apply curse" but I don't see how you could achieve the above using only special effects and JASS. If you say you can, then show me what natives I'm missing out on here, because I'm not finding anything of the sort in the common.j nor blizzard.j files.

    Sorry if I'm just being dense here, but I'm really not getting what you're saying.

    EDIT: Trust me, I don't want to make my own missile system. Me and My friend Arxos did this already, and it was a huge and exceptionally complex system. Look at the first post of this entire thread and read the "Missiles" section. That's what I'm referring to.
     
  13. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Sorry, I got confused to what you meant. I thought you just meant the special effect, but you mean the whole buff. You're right that there's still no way to add buffs/debuffs to units outside of casting spells/abilities. This could be addressed via casting a spell resulting in the desired buff using the Proxy API, but would be more directly solved via a Buff API, which was in the original wish list. I would guess that the Buff API is one of the higher priority remaining features, given that they've already started the push for fully scripted spells, before Blizz goes into pure QA/QC mode
     
  14. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    Thanks for bearing with me. I thought I was just going insane or something and wasn't seeing how buffs and spell effects like it were being done without them being "cast" by something.

    And you're right - a Buff API would be exceptionally useful, especially if it means we could combine multiple effects together (e.g. combining Silence and Curse into a single buff would be interesting, as that's currently utterly impossible to do right now).

    I'm glad we got that all cleared up. So, I suppose we just have to hang on for a while until we get more news or reforged itself lands.
     
  15. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    it's sorta an exercise in patience at the moment. it's funny because the longer we have to wait for reforged to release the more likely we are to get these functions. the majority of new/high-risk scope will probably happen before release, and then there will likely be a greater emphasis on continued stability


    I'd like to request exposing two new natives, both probably already exist under the hood, supporting other natives. It would be useful to have async natives to get (local) mouse position x, y (and optionally location, but I don't see the need since its async so who cares about that particular optimization). There are natives for getting async camera target position x, y; and plenty of async natives for setting/panning camera target position. There is also an async native for setting a player's mouse position, but there are only the synchronized natives for getting mouse position (for trigger player). It would be useful to have async versions of the mouse position getters too, since they can often be used in tandem with the async camera target position logic. Ex an AFK system could elegantly have each local player check their own mouse and cam positions asynchronously, and then synchronize a change in overall AFK state (not total time, but the actual boolean AFK flag) via the new
    BlzSendSyncData
    native with all players registered to receive it.
    Beyond async mouse position fitting in with other existing API's design, they would also serve as a fundamental building block for other systems, that a synced mouse position native is too large to easily fill. That said, I think that the (optimally) synced mouse position is by far the more important native to have, so if it came down to choosing I'd keep that one