• 🏆 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!

[SOLVED] - A unique portal spell

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2008
Messages
346
hi guys...I was planning a portal spell for my warlock hero.

basically you create a demonic portal (Illidan's shimmering portal model is preferred) that persists for 30 minutes and summons a demon every 10 minutes. eventually you get 3 demons in total.

the chance will depend on the demon' power. Which means,

80% probability of summoning a Fel Stalker.
60% probability of summoning a Infernal.
40% probability of summoning a Doom Guard.
20% probability of summoning an Eredar Warlock.
1% probability of summoning the almighty Archimonde(yes, the hero one...so summoning more than one must be prevented).

portal should be like a building so it can be destroyed by enemies. should be low on hp.

I'd be appreciated if this spell is done somehow..I think its a good idea but because of my lack of skills I wasn't able to make it properly. I'll give +rep and my respect ofc:)

one last thing, for the sake of time gaining you guys may not make this spell MUI since only one hero will use it in my map. Its still your choice ofc so you may share it in spells section.

thanks again...have a good day guys.
 
Level 8
Joined
Jan 28, 2016
Messages
486
So this took me a lot longer than I thought it would because I underestimated my probability skills (and the difficulty of implementing non-even chance probability in the Editor). Anyway, I eventually made it work but not exactly with the numbers you posted (check the spoiler). Everything else is in order. By the way, it's not MUI and I set the interval of the timer to 10 seconds as opposed to 10 minutes for test purposes (wasn't gonna wait half an hour per test! xD).

I'm just going to cut 'n' paste what I wrote in the comments section of the Demonic Portal Setup trigger. I know it's not exactly 40% for the Fel Stalkers but yeah...

Probability explanation
It's been a while since I've done any probability but basically what I've done here is to give each unit-type a "chance range" instead of a percentage because it's difficult to directly implement probability into the triggers. Anyway, the numbers in the array are the upper limits of each chance range and are used to check if a randomly generated number from 1 to 100 is less than or equal to the upper limit. The loop in the Summon trigger counts down from 5 to 1 so that if the random number is 50 for instance, it will store the index (i.e: 2 because 50 < DPChance[2]) and ignore the other indices by using a boolean. After the loop, it will create a unit based on the stored index value; in this case an Infernal. Below is the "chance ranges" and the probability. Note that the upper limit values have to be added as well because it's less than or equal to the limit.

Set DPChance[1] = 62 - 100 (39/100) [39%]
Set DPChance[2] = 32 - 61 (30/100) [30%]
Set DPChance[3] = 12 - 31 (20/100) [20%]
Set DPChance[4] = 2 - 11 (10/100) [10%]
Set DPChance[5] = 1 - 1 ( 1/100) [ 1%]

Total: 39+30+20+10+1 = 100

If there's anything I missed, something you want me to clarify or whatever, just let me know. :D
 

Attachments

  • [Demo] Demonic Portal.w3x
    11.8 KB · Views: 50
Level 8
Joined
Jun 13, 2008
Messages
346
So this took me a lot longer than I thought it would because I underestimated my probability skills (and the difficulty of implementing non-even chance probability in the Editor). Anyway, I eventually made it work but not exactly with the numbers you posted (check the spoiler). Everything else is in order. By the way, it's not MUI and I set the interval of the timer to 10 seconds as opposed to 10 minutes for test purposes (wasn't gonna wait half an hour per test! xD).

I'm just going to cut 'n' paste what I wrote in the comments section of the Demonic Portal Setup trigger. I know it's not exactly 40% for the Fel Stalkers but yeah...

Probability explanation
It's been a while since I've done any probability but basically what I've done here is to give each unit-type a "chance range" instead of a percentage because it's difficult to directly implement probability into the triggers. Anyway, the numbers in the array are the upper limits of each chance range and are used to check if a randomly generated number from 1 to 100 is less than or equal to the upper limit. The loop in the Summon trigger counts down from 5 to 1 so that if the random number is 50 for instance, it will store the index (i.e: 2 because 50 < DPChance[2]) and ignore the other indices by using a boolean. After the loop, it will create a unit based on the stored index value; in this case an Infernal. Below is the "chance ranges" and the probability. Note that the upper limit values have to be added as well because it's less than or equal to the limit.

Set DPChance[1] = 62 - 100 (39/100) [39%]
Set DPChance[2] = 32 - 61 (30/100) [30%]
Set DPChance[3] = 12 - 31 (20/100) [20%]
Set DPChance[4] = 2 - 11 (10/100) [10%]
Set DPChance[5] = 1 - 1 ( 1/100) [ 1%]

Total: 39+30+20+10+1 = 100

If there's anything I missed, something you want me to clarify or whatever, just let me know. :D

Oh it was my bad to want those kind of numbers which are not logical for the sake of math:)

I liked it very much^^....some changes might be good though such as;

1-) portal is created exactly 180 degrees opposite angle from the hero..portal should face the hero so demons would be looked like coming towards him.
2-) demons should be made as if they were actually coming from the portal instead of appearing all of a sudden. Can you make them appear right on top of the portal object and made them immediately walk few steps away from it? It would be more realistic and stuff:)
3-) 40% fel stalker and 9% eredar warlock chances would be better.
4-) portal dies right after summoning the last demon...can u make it dying few second later?
5-) I guess prevention of summoning more than 1 Archimonde wasn't implemented?

Apart from these, you made it exactly what I had in my mind...thanks mate. reputation has been given.
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
Oh it was my bad to want those kind of numbers which are not logical for the sake of math:)

I liked it very much^^....some changes might be good though such as;

1-) portal is created exactly 180 degrees opposite angle from the hero..portal should face the hero so demons would be looked like coming towards him.
2-) demons should be made as if they were actually coming from the portal instead of appearing all of a sudden. Can you make them appear right on top of the portal object and made them immediately walk few steps away from it? It would be more realistic and stuff:)
3-) 40% fel stalker and 9% eredar warlock chances would be better.
4-) portal dies right after summoning the last demon...can u make it dying few second later?
5-) I guess prevention of summoning more than 1 Archimonde wasn't implemented?

Apart from these, you made it exactly what I had in my mind...thanks mate. reputation has been given.

All good. I'm working on the changes at the moment and if I don't encounter any bumps along the way, I should be able to get things done real soon.
  1. I had face the same angle as the caster but it's an easy fix (already done).
  2. Definitely would make it look more realistic, walking out of a inter-dimensional gateway like a boss. Shouldn't be too hard.
  3. This makes far more sense than what I did (already done).
  4. Had the same feeling as you did; I think I have an idea for this.
  5. Completely forgot about this! Again, might have a solution to this but I'm not sure if it will work. Will find out soon.
I also found a significant issue with this; because it's non-MUI the spell breaks when you cast it again while another portal exists. What I mean is that you cast the spell and create a portal (let's call it Portal A) and then create another (let's call this one Portal B) while Portal A is up, Portal B overrides Portal A and it never summons any units or dies after the timer ends. Do you want me to set it up so that cast the spell replaces the existing portal or allow it to have multiple portals running at the same time?
 
Level 8
Joined
Jun 13, 2008
Messages
346
All good. I'm working on the changes at the moment and if I don't encounter any bumps along the way, I should be able to get things done real soon.
  1. I had face the same angle as the caster but it's an easy fix (already done).
  2. Definitely would make it look more realistic, walking out of a inter-dimensional gateway like a boss. Shouldn't be too hard.
  3. This makes far more sense than what I did (already done).
  4. Had the same feeling as you did; I think I have an idea for this.
  5. Completely forgot about this! Again, might have a solution to this but I'm not sure if it will work. Will find out soon.
I also found a significant issue with this; because it's non-MUI the spell breaks when you cast it again while another portal exists. What I mean is that you cast the spell and create a portal (let's call it Portal A) and then create another (let's call this one Portal B) while Portal A is up, Portal B overrides Portal A and it never summons any units or dies after the timer ends. Do you want me to set it up so that cast the spell replaces the existing portal or allow it to have multiple portals running at the same time?

Well to be honest I would always prefer it to be MUI but if its too much effort just destroy first portal when you create the second one.(you would increase your chance to summon Archimonde due to multiple portals tho..which is also nice) but as I said, MUI is not mandatory. So its completely up to you.

btw I was thinking about adding more demons to the roster so we wouldn't get too many of the same demons, if its not too much to ask ofc^^

bloodfiend-25%
felstalker-20%
overlord-15%
eredar diabolist-15%
fel ravager-10%
infernal-5%
doom guard-5%
eredar warlock-4%
archimonde-1%

total=100%...chances depend on the demon's unit level, overlord and eredar diabolist have the same lvl so they have the same chances.

with these changes we get more variety of demons and it makes our expectations less predictable which is what I want this portal to do for the most of the time.

But this is something I might do that by myself later though. First, we gotta be sure that the first version is flawless and meets our requirements:)
 
Level 8
Joined
Jan 28, 2016
Messages
486
Alright! :D

Finally got around to making this MUI using Jass along with some configurable variables to allow editing of certain aspects of the spell without messing around with the system. As a heads up, some of these variables are in GUI and the rest are in Jass as constant functions. For the Jass "variables," they're constant functions where you just need to replace the raw codes of the portal unit, the spell and the special effect string (default is the Howl of Terror sfx). I also updated the list of summons and made it so that you can only summon Archimonde once portal.

The GUI triggers are still there (albeit disabled) but I didn't edit them so it won't be MUI like it originally was. Other than that, this should be good to go!
 

Attachments

  • [Demo] Demonic Portal (Updated).w3x
    14.8 KB · Views: 51
Level 8
Joined
Jun 13, 2008
Messages
346
well... you really made my day^^

I have some minor advice again though:)

1-)can u spawn units a little bit behind?..just a little bit:)
2-)as far as I remember, that portal model has its own birth sound...can u change this sound with howlofTerror?....and add DarkSummoningTarget1 sound to when a demon came from the portal? I think a sfx isnt needed for this spell, but I can just leave it empty for myself and you can keep it there for the sake of approval in spells section. But the sound changes are appreciated:)
3-)Can u make Archimonde level 10 with all his abilities learned to highest ranks if he's summoned?

last and optional request;

summoning Archimonde is a huge deal...think about it, you're adding an another hero to your roster from a spell and this isn't just any hero, its Archimonde who can destroy armies by himself. So if this little chance of summoning him actually happens, spell suddenly becomes too OP. So, some extra effects,sounds,animation plays and camera lock on him would be really good...and his iconic speech of course.. "tremble mortals and despair..." thing :D...if you can make this part configurable from GUI it would be just awesome so I can make it for my own taste (unfortunately even though am a software engineer myself, I still can't code Jass:\...don't know its syntax and rules and I'm very busy with C# already:D....but can understand any code(at least algorithm) by reading it...and yours particularly is crystal clear^^)

these were the very lasts requests from my side and imo good changes/additions to make this spell more appealing to not just mine but everyone's eyes.
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
Hey just letting you know that I've been busy lately so I haven't had the chance to get around to adding the latest set of your requests. It might be another day until I can make this happen. In the meantime:
  1. What I did with the spawning was create the units 64 units in-front of the portal (it's a long story; I'll explain later) so their collision is still intact. I'll try and see what I can do.
  2. Changing the sfx isn't a hassle but if there is a birth sound, I haven't heard it. Guess I'll have a look into it unless you know for sure.
  3. This is an easy fix. No worries.
The fancy Archimonde thing shouldn't be that difficult either (I'll probably regret saying that once I stumble upon problems left, right and centre!) but it'll most likely just take some time to put together.
 
Last edited:
Level 8
Joined
Jun 13, 2008
Messages
346
there is a birth sound I'm sure...but as you know those sounds don't play when you add sfx's as dummy units I guess.
making archi lvl 10 is really important...we can't let him be lower lvl than the hero who summoned him. hack you can even add some powerful items to him, just like at the end of reign of chaos.

and yeah that fancy archi summoning like you described is really appreciated:)
 
Level 8
Joined
Jan 28, 2016
Messages
486
Alright! Before I get into this, I want to let you know that I wasn't able to complete all the requests you asked but I managed to do most of it. What is left is essentially the cinematic since I'm hopeless at it but I'll explain it a little later. First, the good stuff.


The Good

I added the item functionality to the code so now when Archimonde is summoned, he gains the items you want. I organised them in a global item-type array in the Demonic Portal Setup trigger so you can change the items there so that you don't have rummage through the Jass code (and so that I could use a loop to add the items to him!). I also made him level up to level 10 and max out all his moves.

The Bad

About spawning the summons a little further back, what kept happening with the larger units is that they would "collide" with the portal and get shifted to the left or right when created. However this isn't as much of a let down, nor as frustrating, as the sounds were. I eventually discovered how to play sounds using Jass but with one massive flaw; sounds created with Jass won't play the first time they're meant to. Apparently there are only two solutions according to Vexorian, "a) ignore the issue or b) "play" the sound at map init." After numerous attempts to preload the sounds at map init, they simply just won't work the first time. Once the specific sound has been played however, everything works perfectly (though it's difficult to hear the DarkSummoningTarget1 audio).

The Ugly

So after futile efforts of trying to create a cinematic, I butchered the test map and well... gave up. Sorry. You might want to ask for someone experienced in that department to make your cinematic. And make it well for that matter! ^_^



I should mention a couple of things I don't think I told you yet. The portal unit (the one under Human>Campaign>Special which I have used) has a death time of 0.940 or there abouts by default. You need to set it to 5 seconds to equal it's death animation for it to show in-game. Also I removed the Howl of Terror special effect that was attached to the spell. So now when you cast it, it won't play it.

Again, sorry about the cinematic (it was truly awful :p) and I'm still working to fix that sound issue. Hopefully I can solve it soon and that someone would be generous enough to help create your epic Archimode cinematic.
 

Attachments

  • [Demo] Demonic Portal (Edit).w3x
    18.6 KB · Views: 69
Last edited:
Level 8
Joined
Jun 13, 2008
Messages
346
I knew about that sound issue. Initializing in map was supposed to work though and you can simply reduce the volume level to 0% so player won't understand anything and with the same way you can pump it up to 100% to make it loudy when it was intended(I noticed it was undertoned). there must be a function for it. For the collision problem, did you try to reduce the portal unit's collision size? I'm not saying anything you don't already know probably but consider it a reminder:)

I discovered a way to run a trigger from a jass code thanks to Vexorian's tutorials. It's called TriggerExecute() "ignores condition" and TriggerEvaluate() "takes condition" and simply call your trigger from it. Check this out;

Code:
SummonArchimonde
    Events
    Conditions
    Actions
        Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
        Unit - Pause all units
        Game - Disable selection and deselection functionality (Disable selection circles)
        Sound - Play WarlockAppears <gen>
        Wait 2.00 seconds
        Animation - Play (Last created unit)'s spell slam animation
        Wait 3.13 seconds
        Animation - Reset (Last created unit)'s animation
        Cinematic - Send transmission to (All players) from (Last created unit) named Archimonde: Play U08Archimonde19 <gen> and display Tremble, mortals, a....  Modify duration: Add 0.00 seconds and Wait
        Unit - Unpause all units
        Game - Enable selection and deselection functionality (Enable selection circles)
        Camera - Reset camera for (Owner of (Last created unit)) to standard game-view over 0.00 seconds
        Sound - Play Doom <gen>

you don't even have to check if unit is Archimonde though since you will run this trigger when Archimonde is summoned already.

Code:
call TriggerExecute(gg_trg_SummonArchimonde)

I put this code right after you create archimonde unit. It works but not like as I want it to be...for example camera doesnt lock on him and stuff....you might have some technical idea behind this reason and I think you can perfect it.
 
Level 8
Joined
Jan 28, 2016
Messages
486
It's weird because the preload trigger I created for the sounds should work but obviously it doesn't. I have the volume set to zero as well and I am yet to find a solution to this problem. Might have to open a thread about it in the Triggers & Scripts forum. By the way, what did you mean by "it was undertoned?" With the collision, I gave the portal a collision size of 8 because apparently units have collision size ranges as opposed to specific values (check the end of this thread; it makes much more sense) and spawned the summons slightly back but I'm not sure how much of a difference there is.

As for the cinematic, I found this awesome tutorial by our one and only Purge and Fire which helped heaps. I also took your code from above as a template to create it. Cheers for that! I'm posting what I got so far to see if it's close to what you imagined because it's still a bit rough around the edges and I added some extra special effects to it (the map is empty so it probably doesn't help here). It's setup to only play for Player 1 (Red) at the moment so I'm assuming this won't work properly in a multiplayer game without some adjustments but it shouldn't be a huge concern.

Anyway, have a go and let me know what you think of it so far. :D
 

Attachments

  • [Demo] Demonic Portal (Cinematic).w3x
    20.6 KB · Views: 68
Last edited:
Level 8
Joined
Jun 13, 2008
Messages
346
Well that's it then^^

Right now everything works just fine;)...you even learned cinematics and such to make what I wanted in this spell and I wasn't even thinking further of what you see in the triggers I posted. This spell right now has become even better than what I had in my mind in the first place:D I improved the cinematic for my taste, though. At least that's where I'm good at^^

For that sound issue; even if initialization for sounds doesn't work then that means game engine doesn't allow us to do so. I'm ok with this fact;).... But in my opinion sound is still low to be heard even after the first casting. I guess you can configure them via variables instead of calling sounds directly from their path. this way they can be configured from sound editor to do extra stuff like stopping spell sounds being heard from afar. I don't know jass so I can't say if you already did those configs or not:S

One last thing about this whole thing:)
What kind of algorithm you used to prevent the summoning of more than 1 archimonde? I might apply it to the second strongest demon behind him if I wanna add an another hero to the roster, maybe like Mannoroth? plus maybe some unique demon units? like doomlord Kazzak, a strong type of doomguard unit but not a hero. I was thinking about this because in my map this spell won't spawn a demon in every 10 seconds but 2-3 or maybe 5 mins. So there's a very good chance that I won't get Archimonde at all:) But with these one time summonable unique demons we can get the player excited about expectations. As I said my map is kind of desperation map already so any kind of help from Burning Legion is still useful:p I might try copy/pasting what you did for archimonde but I don't wanna do this through "trial and error" way, I wanna know whats going on behind it so I can do anything by knowing it.

It also seems like you changed the probability mechanics a bit but I can still decrease like say eredar warlock's chance to 3% and add my new hero as 2% right? It won't break anything? I know I must also change the arrays size yeah:)..I'm just wondering about the spell's configurability...I think its also an important factor for the approval in the spells section:)

"my unending list of requests finally ends..." :D
 
Level 8
Joined
Jan 28, 2016
Messages
486
You won't believe this but I was playing around with the map again and discovered that Archimonde losses all his sounds after he is summoned. My luck! No idea why that happens to the unit but I guess all of these sound issues are worth a thread in Triggers & Scripts. :p

As for the summoning "algorithm" I check if the random integer was equal to 1 in the loop that spawns the summons and if so, save a boolean into the portal as true. In a short If-Then-Else statement just before the summoning loop, I check if that same boolean stored under the portal was true or not. If true, meaning that Archimonde has already been summoned, set the random integer range from 2 to 100; otherwise set it from 1 to 100. This method won't work when having multiple "rare" units in the summons list but hey, it gets the job done for that one, special someone!

About the probability for the new hero, it would range have to range from 2 to 3 inclusive so that it would have a 2% (2 in 100) chance of being spawned. The warlock would need to have the same range (from 4 to 5) to avoid shifting all of the other percentages. The spoiler will make more sense.

  • Comparison
    • Events
    • Conditions
    • Actions
      • -------- Summon Chance Setup 1 --------
      • Set DPChance[1] = 100
      • Set DPChance[2] = 75
      • Set DPChance[3] = 55
      • Set DPChance[4] = 40
      • Set DPChance[5] = 25
      • Set DPChance[6] = 15
      • Set DPChance[7] = 10
      • Set DPChance[8] = 5
      • Set DPChance[9] = 3
      • Set DPChance[10] = 1
      • -------- --- --------
      • -------- --- --------
      • -------- Summon Chance Setup 2 --------
      • Set DPChance[1] = 100
      • Set DPChance[2] = 76
      • Set DPChance[3] = 56
      • Set DPChance[4] = 41
      • Set DPChance[5] = 26
      • Set DPChance[6] = 16
      • Set DPChance[7] = 11
      • Set DPChance[8] = 6
      • Set DPChance[9] = 3
      • Set DPChance[10] = 1
SummonSetup 1 ChanceSetup 2 Chance
Bloodfiend25%24%
Fel Stalker20%20%
Overlord15%15%
Eredar Diabolist15%15%
Fel Ravager10%10%
Infernal5%5%
Doom Guard5%5%
Eredar Warlock2%3%
Mannaroth2%2%
Archimonde1%1%

By the way, the cinematic in it's current state isn't MUI so if you cast two portals and they both summon Archimonde, the first portal will stop working (no more summons, won't disappear by itself, etc.). I can fix that up a little later though.
 
Level 8
Joined
Jun 13, 2008
Messages
346
I made some tests and cast the spell almost 20 times simultaneously to make sure spell works fine under all conditions and even after making rand(1,100) it still spawns archimonde more than once:\....it think it was always like this I just hadn't done enough tests to know it. After getting one archi I started to cast multiple portals again(after all of the old ones expired) and again I get many archimonde's:\...I guess your control wasn't working at all:(

Edit : can confirm that it was always like this so either your "rare" control isn't working properly or we need something else. I think spell should check if there's an archimonde unit in the map already, and it should do this in a loop I guess...or everytime right before any individual portal's tick. And once he's summoned, substract 1 from the DPSummonsMax(decrease its size by 1). At least that's how I think it should act, but you know better.
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
Hey I know this is long overdue but I was unable to access the site, let alone log in, since the DNS hack. I saw you made a thread about this issue in the Triggers & Scripts sub-forum but I can't find it, so I'll just post this here.

The "rare" variable is MUI so for each portal that is created, there is always a chance to summon Archimonde. If you want to make it so that all portals are unable to summon Archimonde again, you can make the variable a global instead (through the Variable Editor of course).

This is probably a bit too late but I thought I'd better let you know just in case. By the way, did you manage to find a solution in that other thread?
 
Level 8
Joined
Jun 13, 2008
Messages
346
Hey man...its been a while:)
Yeah those guys helped me fixing my problem by making it global varible just like you said, right now I won't get more than 1 archimonde for any player or no matter how many times I cast the spell back to back, which is what I wanted.
 
Status
Not open for further replies.
Top