HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

2 Questions

08-14-2005, 10:21 PM#1
Kalvorod
( I know it looks like I have been asking a lot of questions today, but most of those are old topics, and besides I think I reserve the right to post several times about different things with all the help I've been giving ; ) )


Question 1: I have a script that does
Event: When (Footman0001) is selected
Condition:
Action: If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Random unit from (Units owned by (Triggering player)))) Less than 100.00
Then - Actions
Unit - Set life of (Random unit from (Units owned by (Triggering player))) to 100.00%
Sound - Play Cast8 <gen>
Else - Actions



Basically what that is supposed to do is make is so that when you click this unit, if your health is lower than 100% then you heal and it plays a sound. Only problem is that I use Triggering player which I'm almost certain does not apply to that event (>_<) How can I do this so that the unit owned by the selecter is healed.(currently nothing happens, but before I added the triggering player thing, a random unit owned by anyone was healed)



Question 2: I want that sound effect to only play for the triggering player so as not to annoy other players, how can I do this?( This is probobly simpler)
08-14-2005, 10:35 PM#2
Thunder_Eye
Well, Ive used Triggiring Player in a select event,
works fine for me.

And If this is an RPG (or something alike) you should make the unit an variable, like
Player_Hero Unit Array (<your number of players>)

and then just make it:
Set life of Player_Hero(Player number of (Triggering Player)) to 100.00%
or something, just a tip.
08-15-2005, 02:42 AM#3
Kalvorod
It isn't working, I tried it like 10 times in a row, and I only own 1 unit so it can't be selecting anything else.

Are you sure it works? hmmm I think I have used it before too... It just doesn't make sense. I will try storing to a variable...


Any ideas on the sound thing?

EDIT: Setting to a varaible doesn't work, infact it's worse. Now the sound plays but the unit still isn't healed. Also the sound is being played when the unit is at full health, which means that the condition statment is falsly being declared as true. At least before the statment was not playing the sound when you were at full health...

Edit2: I checked an old map of mine, and I used
Event:Player 1 selects a unit
condition: unit type of triggering unit is:footman
action: etc etc

That worked for me before. If I don't post agian assume that It worked again.



Still having that problem with the sound though, any ideas?




.
08-15-2005, 09:07 AM#4
Thunder_Eye
Not sure if this works, But it do for Fade Filter,
Set tempPlayer = Player 1 (Red)
Custom Script: if GetLocalPlayer() == udg_tempPlayer then
Play Sound <bla bla bla>
Custom Script: endif

It might work, try test it.
08-15-2005, 12:15 PM#5
oNdizZ
instead of Triggering Player
Owner Of (Selected Unit) ?
08-15-2005, 02:19 PM#6
Kalvorod
Thundereye: ? Huh what does that do? I'll try it, but somehow I don't think you understood what was the problem....


oNdizZ: I got it working, I needed to use the even Player Selects a unit in conjunction with if triggering unit==footman001, rather than unit is selected unit==footman001. I don't believe there is the ability to use Owner of Selected Unit, but even so, it's for a neutral unit so it wouldn't work. It's ok now, I got that working.


I think I see what you're saying now thunder, but I can't really tell if it works until I can find a friend online to test(don't want to spread my map around before it's ready).


I want to play for the triggering player, not the owner of the selected unit, and I've figured out how to find the triggering player, but not how to play it for them only.
08-15-2005, 02:25 PM#7
Thunder_Eye
Well I wasnt sure If he meant selecting his own unit or an friendly.

If the trigger I posted works, I should only play the sound to tempPlayer.

Though remember Im not sure if it works.

and btw. sry thought you used an player select event, thats when the "triggering player" works
08-15-2005, 02:32 PM#8
Kalvorod
lol, np, I figured it out soon enough. But like I said in my edit above, I won't be able to tell if it works until my friends get on(if at all ).
08-15-2005, 03:38 PM#9
Thunder_Eye
Ok, I'll wait for your respond