| 05-05-2007, 05:14 PM | #1 | |
Im having problem trying to compile something, but it doesnt seem to work, and the compiler seems to misunderstands, but not sure. First here is the structs that it's trying to compile:
and the attached image is the error i get when saving. And yes B is desclared to be local Ball B |
| 05-05-2007, 05:34 PM | #2 |
I find it amusing that you did not post the relevant code where is the PolledWait(0.001) call? Also, how about overriding create instead of making a Create one? |
| 05-05-2007, 05:39 PM | #3 |
if you want the whole function then here it is: JASS:function Trig_Trow_Actions takes nothing returns nothing local real Acceleration = -2.5 local real ZOffset = 80 local real Speed = 40 local Ball B local unit TrowingUnit = GetSpellAbilityUnit() local integer Mi = GetUnitUserData(TrowingUnit) local motion M2 = motion(Mi) local location locA = GetUnitLoc(TrowingUnit) local location locB = GetSpellTargetLoc() local real x = GetLocationX(locB) - GetLocationX(locA) local real y = GetLocationY(locB) - GetLocationY(locA) local real z = 0 local vector V local player pl = GetOwningPlayer(TrowingUnit) local real TerrainHeight = GetLocationZ(locA) local real S = SquareRoot((x*x)+(y*y))*0.03 local real t = S/Speed local real SpeedZ = -(0.5*Acceleration*t)/0.03 set y = y/(SquareRoot(x*x)) set x = x/(SquareRoot(x*x)) set V = vector.Create(x,y,z) call V.SetLength(Speed) set x = V.x set y = V.y call V.destroy() call RemoveLocation(locA) call RemoveLocation(locB) set locA=null set locB=null call IssueImmediateOrderBJ( TrowingUnit, "stop" ) call PauseUnit(TrowingUnit, true) call PolledWait(0.001) call SetUnitAnimation( TrowingUnit, "Attack" ) call QueueUnitAnimationBJ( TrowingUnit, "stand" ) call PolledWait(0.001) if (M2.Scalar1==0) then set udg_Trows[GetConvertedPlayerId(pl)] = udg_Trows[GetConvertedPlayerId(pl)]+1 call PauseUnit(TrowingUnit, false) call RemoveItem( GetItemOfTypeFromUnitBJ(TrowingUnit, 'I000') ) set B = Ball.Create(BallTypes[0],pl,GetUnitX(TrowingUnit),GetUnitY(TrowingUnit),TerrainHeight+ZOffset) call B.M.SetSpeed(x,y,SpeedZ) call B.M.SetAcseleration(0,0,Acceleration) set B.M.Bouncy = 0.80 set B.M.Friction = 0.70 call GroupAddUnit(udg_TheBalls,B.M.Particle.Unit) endif set pl = null set TrowingUnit = null endfunction |
| 05-05-2007, 05:47 PM | #4 |
do you happen to have a collision variable called "Ball" somewhere? |
| 05-05-2007, 07:21 PM | #5 |
nope i dont :) All collision variables are called C, C1,C2... ect |
| 05-06-2007, 03:29 AM | #6 |
well, I'll need originals, either just the map script or the map. |
| 05-06-2007, 04:51 AM | #7 |
well the map is my dodge ball map... Everything works in it now since i use lowercase, but try change it to Ball then it will bug. Link to newest version submission: http://www.wc3campaigns.net/showthre...309#post934309 |
| 05-06-2007, 01:07 PM | #8 |
do you notice that map is optimized? |
| 05-06-2007, 06:35 PM | #9 |
oh shit... forgot... i will send u the not optimized one |
| 05-06-2007, 07:41 PM | #10 |
You got plenty of Ball named variables, You even got local collision Ball
Because of that if you did Ball.something , even if there was an struct called Ball , it will assume you are trying to use the Ball variable, you can call static members from variables so there you go. It is not good to have variables named the same as custom types, it would just cause conflicts I am gonna make sure to prevent them by popping out errors in those cases. |
| 05-06-2007, 10:44 PM | #11 |
oh where did i have collision Ball :P |
