HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

3 Questions (Again)

04-18-2007, 05:03 AM#1
Hydrolisk
1: I have a Mirror Image ability and a Thunder Clap ability in a spell book for my Hero.
I have followed tutorials correctly and he now has a % chance to cast the Thunder Clap (from spell book). Same with Mirror Image.
My problem is that for some reason, he never casts the Clap (and Image) even though I've set up everything right. I even gave him the spell book and used triggers to make him cast it, but to no avail.
Need help on how to make it work. I've been thinking about dummies, but a spell book would be ten-fold easier.

2: My damn leader board won't work!
Trigger:
Collapse Events
Time - Elapsed game time is 1.00 seconds
Conditions
Collapse Actions
Leaderboard - Create a leaderboard for (All players) titled Killboard
Set kills_lb = (Last created leaderboard)
Custom script: set bj_wantDestroyGroup=true
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked player) slot status) Equal to Is playing
Collapse Then - Actions
Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
Else - Actions
Leaderboard - Show (Last created leaderboard)

Second part.
Trigger:
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Triggering unit)) controller) Equal to User
Collapse Actions
Set kills_i[(Player number of (Owner of (Killing unit)))] = (kills_i[(Player number of (Owner of (Killing unit)))] + 1)
Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to ((Player number of (Owner of (Killing unit))) + 1)
Leaderboard - Sort kills_lb by Value in Descending order
Player - Set (Owner of (Killing unit)) Current gold to (((Owner of (Killing unit)) Current gold) + 2)
I don't get why it won't work. I followed a tutorial too...

3: This won't work either. Idea: Auto-Cast Faerie Fire that switches places with caster and target, then ordering Hero to Mirror Image (which is within the spell book).
Trigger:
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Shuffle
Collapse Actions
Set shuffle_tp = (Position of (Target unit of ability being cast))
Set shuffle_cp = (Position of (Triggering unit))
Unit - Order (Triggering unit) to Orc Blademaster - Mirror Image
Unit - Move (Target unit of ability being cast) instantly to shuffle_cp
Unit - Move (Triggering unit) instantly to shuffle_tp
Custom script: call RemoveLocation( udg_shuffle_cp )
Custom script: call RemoveLocation( udg_shuffle_tp )
04-18-2007, 09:07 AM#2
Tide-Arc Ephemera
What makes you think that people are keen after what you did last time... I've never used LB so explain to me what "works" is and I may be able to help you a lil... just a lil...
04-18-2007, 09:58 AM#3
Hydrolisk
The LB stops at 3 for me and 2 for the one computer opponent.
04-18-2007, 12:59 PM#4
akolyt0r
1. dunno ...

2:
Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to ((Player number of (Owner of (Killing unit))) + 1)

Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to (kills_i[(Player number of (Owner of (Killing unit)))])

3: Trigger seems to be correct ...give some more details ...
u dont need to remove global locations ...
04-18-2007, 02:48 PM#5
Ammorth
Quote:
Originally Posted by akolyt0r
Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to (kills_i[(Player number of (Owner of (Killing unit)))] + 1)
No need for the + 1 since it was already accounted for in the previous line.

3. I don't think you can detect when a spell is auto-casted; at least I have never been able to. Someone correct me if I am wrong.
04-18-2007, 02:57 PM#6
akolyt0r
you are wrong (at least i think he doesnt want to detect IF it was autocasted...but if it was casted in general ...)
04-18-2007, 03:17 PM#7
Rising_Dusk
Depends on the autocast spell in question.
If it's an on-attack, base it on incinerate and detect the buff it leaves on the target.
This adjusts automatically for autocast or click-cast.

If it's anyother spell, you can EVENT_PLAYER_UNIT_SPELL_EFFECT (Spell effect) trigger detect it.
If you want to know if it's being autocast or not for whatever reason, detect the orders "faeriefireon" (Or whatever it is for whatever autocast spell you are using) and then set some boolean attached somehow to the unit to true.
If it is "faeriefireoff" (Or whatever) then set said boolean to false.
04-18-2007, 04:34 PM#8
blu_da_noob
1) Not enough information. Have you debugged, say, at all?

2) Firstly, (All Players) doesn't leak, it's a constant global force. Secondly, I don't think the wantdestroygroup 'hack' even works with forces. But it isn't necessary, so remove it. You're going to be screwing up some other group thing in your map. Your problem with no displaying correctly is:
Trigger:
Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to ((Player number of (Owner of (Killing unit))) + 1)
This sets the value for a player to the player number of the player + 1. So player 1 will always have a 2, player 2 will always have a 3... surely you noticed something like that? Oh yes, and debug more plz. You want:
Trigger:
Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to (kills_i[(Player number of (Owner of (Killing unit))])

3) I'm pretty sure autocast normal spells work fine for detection. Your problem in your trigger is that you issue the order for Mirror Image before moving the unit. Moving the unit interupts the order so just move the order actions to after the move actions.

Oh, and debug more plz.
04-18-2007, 04:44 PM#9
Captain Griffen
Can't cast stuff via triggers from spellbook. Hmm...actually, I think you might be able to with order IDs if it has its own ID, not sure, but not with strings.
04-18-2007, 05:05 PM#10
blu_da_noob
Quote:
Originally Posted by Captain Griffen
Can't cast stuff via triggers from spellbook. Hmm...actually, I think you might be able to with order IDs if it has its own ID, not sure, but not with strings.

Nah, someone submitted a spell a while back which used casting from within a (hidden) spellbook via GUI triggers.

Edit: Oh yeah, and this is entirely relevant to T&S. Why did you post it here?
04-18-2007, 05:08 PM#11
Captain Griffen
Quote:
Originally Posted by blu_da_noob
Nah, someone submitted a spell a while back which used casting from within a (hidden) spellbook via GUI triggers.

Linkie, because I thought that was impossible.
04-18-2007, 05:34 PM#12
blu_da_noob
Edit: aah, k never mind. The map is gone and my memory is faulty in any case. But I checked the map and it does have a way to cast something 'invisibly' with GUI. Have the ability on your unit normally and have it disabled for the player. To cast it invisibly, enable the ability, issue the order and then instantly disable the ability.

I mentioned it to Dusk and he said a Divine Shield ability cast from inside a spell book didn't work so well for him, so it might not work for all abilities?
04-18-2007, 05:41 PM#13
Captain Griffen
Me see no map.
04-18-2007, 06:25 PM#14
Hydrolisk
Thanks guys. I thought that the problem was in Move unit...

I blind eyes couldn't pay much of a damn to see the LB problem. Damn. Thanks anyways.
04-18-2007, 11:04 PM#15
Ammorth
Lets break down the multiboard to 1 variable, and then you can add the arrays in later.

Now, we have an integer variable "Kills"
Trigger:
Leaderboard
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Triggering unit)) controller) Equal to User
Collapse Actions
Set Kills = Kills + 1
Leaderboard - Change the value for (Owner of (Killing unit)) in kills_lb to Kills
Leaderboard - Sort kills_lb by Value in Descending order
Player - Add 2 gold to (Owner of (Killing unit))

Notice how I change the value being displayed to the variable and I increase the variable before I do that.

There is also a function to add gold for a player, which may be easier to read than your current method.

Now, once you get that down you can make it arrays and it will be jolly good.