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

[General] Pitch Angle ...Trigger ???

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
No need to. The current unit is always the one in the variable SpartFaceUnitVariable[Player Number] Just set any variable equal to that one.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
For God's sake xD Did you test the map? Did you notice how I added 2 unit types in map initialization? Just do the same with all your unit types.
OMMMMMG .. When I just press 'TEST MAP' ...Your triggers are disabled due to some errors ...Why the hell does this happen?????????? Ok Shit WE is really buggy they work now
Add +1 to each one
AW , You said player 1 is 0 in JASS. but you said add +1 to them ......?!

No need to. The current unit is always the one in the variable SpartFaceUnitVariable[Player Number] Just set any variable equal to that one.

Well I didn't understand. And I think I will never ever understand. I'm sick. :ogre_rage:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1. You need JNGP and last Jasshelper (both on my signature)

2. Becasue your movement triggers works with GUI Player index (1, 2, 3, 4) and Mine in JASS works with 0, 1, 2, 3. If you set all the pn = pn+1 you'll match the JASS index with the GUI index.

3. What's the GUI Global Variable you're using to move the units?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1. In SpartFaceUnitReplace function inside SpartFace Unit Data trigger, look for this
JASS:
function SpartFaceUnitReplace takes integer pn returns nothing
    set pn = pn+1 <<--- This solves all the pn problems in this function.
    local unit u = LoadUnitHandle(SpartFaceHash, GetHandleId(SpartFaceCurrent[pn]), 0) // The Opposite Facing

2. In the SpartFace Unit Set trigger look for this
JASS:
    set SpartFaceRight[OwnerNumber] = TRUE
    
    set udg_Hero1_2D[OwnerNumber]= Current <-- This solves your issues
    set udg_Hero2_2D[OwnerNumber]= Opposite <-- This solves your issues
    
    call KillUnit(GetBuyingUnit()) // Just for testing
    call KillUnit(GetTriggerUnit()) // Just for Testing

3. Do this in both SpartFace StR and StL triggers (just add the +1)
JASS:
local integer pn = GetPlayerId(GetTriggerPlayer()) + 1

That should solve all your issues.

NOTE: If you copy/paste you have to remove the things i wrote with the "<---" else it will give errors.

EDIT: Be carefull with this. Here you have to substract the 1 again
JASS:
if (GetLocalPlayer() == Player(pn-1)) then
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1 and 3- Matches JASS Index with GUI Index
2- Sets the Right/Left facing units to your Right/Left facing variables
4- Makes the player select the unit after replacing it with the opposite facing
 
Status
Not open for further replies.
Top