HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Multi-Instancablility with GUI...

07-04-2006, 04:39 AM#1
Ignitedstar
For some strange reason while I was looking through the search, I couldn't find anything that directly related to this problem. And when I did, someone said it was so outdated that it should get deleted.

So, why not directly ask:

How do you make a GUI triggered spell Multi-Instancable?

And(they are probably the same or just because I feel like it), how would you do the same with JASS code?
07-04-2006, 06:47 AM#2
SnaKy
Try to not use waits and similar stuff, that could do the thing. With jass you can use local variables and gamecache...You gotta read some tutorial about jass better...
07-04-2006, 07:22 AM#3
Thunder_Eye
you can make the globals locals I think, Vex made a tut on this If I remember right.
But it's something like this:
local unit udg_Hero = GetTriggerUnit()

where "Hero" is your global variable
07-04-2006, 07:22 AM#4
The)TideHunter(
To make a GUI spell multi-instancable, all you have to do in my opinion is make all of your globals into locals.

Example:

Not Multi-instancable: (I used a global unit, Target)
Trigger:
Weird Spell
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Banish
Collapse Actions
Set Target = (Target unit of ability being cast)
Wait 5.00 seconds
Animation - Play Target's attack animation
Wait 2.00 seconds
Unit - Kill Target

Multi-instancable: (I use a local unit Target)
Trigger:
Weird Spell
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Banish
Collapse Actions
Custom script: local unit Target = GetSpellTargetUnit()
Wait 5.00 seconds
Custom script: call SetUnitAnimation( Target, "attack" )
Wait 2.00 seconds
Custom script: call KillUnit( Target )
Custom script: set Target = null
I used custom script in there because you cant have locals in GUI (well you can but you cant put them into fields like Kill Unit)

I kept the same spell, but where the target was needed, i converted to custom text, found the line which each of the other lines was refering to, copied it, and pasted it into a custom script, changing the udg_Target to Target.

Thats a good way to start.

EDIT: Added a line to nullify Target
07-04-2006, 07:27 AM#5
Fulla
Would that not leak at all?
07-04-2006, 07:31 AM#6
The)TideHunter(
No, not from what i can see of.
EDIT: I surpose you could set Target to null because its dead now, and it is a local.
I will change it.
07-04-2006, 07:32 AM#7
SnaKy
Trigger:
Weird Spell
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Banish
Collapse Actions
Custom script: local unit Target = GetSpellTargetUnit()
Wait 5.00 seconds
Custom script: call SetUnitAnimation( Target, "attack" )
Wait 2.00 seconds
Custom script: call KillUnit( Target )
Custom script: set Target = null
You have to nullify the local variable...
07-04-2006, 08:22 AM#8
Ignitedstar
Prehaps this kind of stuff should get stickied for future reference...

Thanks a lot you guys.
07-04-2006, 08:47 AM#9
iNfraNe
Simpler, like thunder_eye said:
Trigger:
Custom script: local unit udg_TempUnit = GetSpellTargetUnit()
Wait 5.00 seconds
Animation - Play TempUnit's attack animation
Wait 2.00 seconds
Unit - Kill TempUnit
set TempUnit = No Unit

And naw, it shouldnt get stickied since there are tutorials about it. If you wouldve searched you wouldve found this: http://www.wc3campaigns.net/showthread.php?t=34204
07-04-2006, 09:04 AM#10
Ignitedstar
Well, pardon me. It's too late now, isn't it?

Besides, I wanted this to be direct, not with a bunch of other things in the way.
07-04-2006, 10:27 AM#11
The)TideHunter(
Quote:
Originally Posted by iNfraNe
Simpler, like thunder_eye said:
Trigger:
Custom script: local unit udg_TempUnit = GetSpellTargetUnit()
Wait 5.00 seconds
Animation - Play TempUnit's attack animation
Wait 2.00 seconds
Unit - Kill TempUnit
set TempUnit = No Unit

Yea you could trick the editor with udg_name, but you can only do that 1 with variable.
I dont think its easier anyway, its a long method for a short result.
07-04-2006, 11:01 AM#12
sheep.spirit
Basically, it is not really possible to make a multi-instancible GUI spells because in the end, the customs scripts and locals are actually jass, u still have to know Jass to make a GUI spell multi-instancible, kinda ironic. But i can suggest that you learn jass, it is seriuosly much faster, but other than that, i can find no other way other than those TideHunter) and infared had suggested : Custom Scripts
07-04-2006, 11:14 AM#13
Thunder_Eye
Funny is that custom script is JASS, so if you're gonna use custom script that much, you can just learn JASS instead.
07-05-2006, 06:18 AM#14
Ignitedstar
Actually, I kind of already knew that Multi-Instancability had to be done in JASS. I just wanted to confirm it.

I've read some of the basic tuts for JASS. I sort of understand it, I guess. Although, I can only learn so much in a day. So, I'm trying to learn nice and slow, otherwise everything I read to myself goes into one ear and goes out the other.

Yes, and I already know that custom script is JASS. Thanks for saying it though, everyone.
07-05-2006, 07:47 AM#15
Anitarf
Back when I started making my arena map, I didn't use Jass, but my spells were still 100% multi instanceable, so it's quite possible to do in GUI - possible, but of course using Jass is way more optimized. I started using Jass scripts for memory leak destruction long before I started using local variables.