HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Multi-Played Instanceability Needed.

09-29-2007, 10:46 PM#1
Monky-Master
This is the code I have. It creates a fade blend filter for the player who casts the ability, BUT, the problem is, I don't know how to assign it so it's an array. Just look at the custom script...

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to Zoom In
Collapse Then - Actions
Custom script: call CinematicFilterGenericForPlayer(GetOwningPlayer( GetSpellAbilityUnit( ) ), 2.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\Sniper Rifle Scope", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 0.0 )
Unit - Add Zoom Out to (Casting unit)
Unit - Remove (Ability being cast) from (Casting unit)
Unit - Set Unit_Camera_Lock[(Player number of (Owner of (Casting unit)))] movement speed to 0.00
Set Zoomed[(Player number of (Owner of (Casting unit)))] = True
Set Snipe_Angle[(Player number of (Owner of (Casting unit)))] = 360.00
Set FarZ[1] = (FarZ[1] + 1000000000.00)
Set Height_Offset[(Player number of (Owner of (Casting unit)))] = 150.00
Else - Actions
09-29-2007, 10:59 PM#2
The Elite
hmm... its a tricky one, try using custom script to make the variables locals, eg

Trigger:
Custom Script: local boolean array zoomed
Set Zoomed[(Player number of (Owner of (Casting unit)))] = True
and do that for the rest of your variables
09-29-2007, 11:04 PM#3
Monky-Master
Hrm. I see what you did. That would require me to re-do the entire script though.

If I create a Player Array and assigned them to players, is it possible to insert it into my custom script?
09-29-2007, 11:14 PM#4
The Elite
just do this:
Trigger:
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Zoom In
Then - Actions
Collapse -------- Start local variabnles --------
Custom script: local boolean array udg_Zoomed
custom script: local real array udg_Snipe_Angle
Custom script: local real array udg_FarZ
Custom script: local real array udg_Height_Offset
Collapse --------End local variables --------
Custom script: call CinematicFilterGenericForPlayer(GetOwningPlayer( GetSpellAbilityUnit( ) ), 2.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\Sniper Rifle Scope", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 0.0 )
Unit - Add Zoom Out to (Casting unit)
Unit - Remove (Ability being cast) from (Casting unit)
Unit - Set Unit_Camera_Lock[(Player number of (Owner of (Casting unit)))] movement speed to 0.00
Set Zoomed[(Player number of (Owner of (Casting unit)))] = True
Set Snipe_Angle[(Player number of (Owner of (Casting unit)))] = 360.00
Set FarZ[1] = (FarZ[1] + 1000000000.00)
Set Height_Offset[(Player number of (Owner of (Casting unit)))] = 150.00
remember all global variables have an "udg_" prefix before them in jass
AND DONT delete your globals
09-29-2007, 11:34 PM#5
Monky-Master
Oh wow, thanks!
09-29-2007, 11:37 PM#6
The Elite
your welcome, and i gave you rep because its lame to have none
09-29-2007, 11:39 PM#7
Monky-Master
Lol. Repped for helping me. =)
09-30-2007, 07:18 AM#8
Pyrogasm
You can't do that. Local variable declaration has to be done before any code in the trigger. You're trying to declare locals after an If statement.
The other thing is that I'm pretty damn sure that GUI Locals trick only works once per trigger.


Edit: What is the purpose of this code, anyway? You're using locals when you have no need to.
09-30-2007, 08:41 AM#9
The Elite
but just do it at the start of your trigger, Monkey
10-01-2007, 05:53 AM#10
Monky-Master
Quote:
Edit: What is the purpose of this code, anyway? You're using locals when you have no need to.

The code is to create a custom filter for a specific player. I tested the map with my friends, and the camera would go all screwy, so the locals are needed to un-screw that screw.
10-02-2007, 08:41 PM#11
darkwulfv
I don't think the locals will do anything for you, I'm not sure.