• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Need help with theese Local Variables, and the setting of them

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
Ok im making a SmokeBomb but the errors i get i dont understand :p
i get the errors:
JASS:
Line 1240: Type mismatch in assignment
[set SET = "GreySmoke.mdl"]
Line 1241: Type mismatch in assignment
[set SETa = "BlackCloudOfFog.mdl"]
Line 1244: Invalid argument type (effecttype)
[set SEa = GetLastCreatedEffectBJ()]
Line 1262: nvalid argument type (effecttype)
[    set SE[Count] = GetLastCreatedEffectBJ()]

Ok now for what i have done
  • Smoke Grenade
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Smoke Grenade
    • Actions
      • Custom script: local unit a
      • Custom script: local unit b
      • Custom script: local location Point
      • Custom script: local location CP
      • Custom script: local player Owner
      • Custom script: local group Group
      • Custom script: local real Rotation
      • Custom script: local integer Count
      • Custom script: local location SP
      • Custom script: local effect array SE
      • Custom script: local effect SEa
      • Custom script: local effecttype SET
      • Custom script: local effecttype SETa
      • -------- Theese Effects are Imported so dunno how to set up them :( --------
      • Custom script: set SET = "GreySmoke.mdl"
      • Custom script: set SETa = "BlackCloudOfFog.mdl"
      • -------- Theese Effects are Imported so dunno how to set up them :( --------
      • Custom script: call AddSpecialEffectLocBJ( Point, SETa )
      • Custom script: set SEa = GetLastCreatedEffectBJ()
      • Custom script: set Count = 1
      • Custom script: set Rotation = GetCameraField(CAMERA_FIELD_ROTATION)
      • Custom script: set a = GetTriggerUnit()
      • Custom script: set Owner = GetOwningPlayer( a )
      • Custom script: set Point = GetSpellTargetLoc()
      • Custom script: set CP = GetUnitLoc( a )
      • Custom script: call CreateNUnitsAtLoc( 1, 'h007', Owner, CP, Rotation )
      • Custom script: set b = GetLastCreatedUnit()
      • Custom script: call UnitApplyTimedLifeBJ( 3600.00, 'BTLF', b )
      • Custom script: call IssuePointOrderLocBJ( b, "attackground", Point )
      • Custom script: call TriggerSleepAction( ( DistanceBetweenPoints(CP, Point) / 625.00 ) )
      • Custom script: call RemoveUnit( b )
      • Custom script: set b = null
      • Custom script: loop
      • Custom script: exitwhen Count > 12
      • Custom script: set SP = PolarProjectionBJ(Point, 150.00, ( I2R(Count) * 30.00 ))
      • Custom script: call AddSpecialEffectLoc( SP, SET )
      • Custom script: set SE[Count] = GetLastCreatedEffectBJ()
      • Custom script: call RemoveLocation ( SP )
      • Custom script: set Count = Count + 1
      • Custom script: endloop
      • Wait 0.50 seconds
      • Custom script: set Group = GetUnitsInRangeOfLocMatching(500.00, Point, Condition(function SmokeGroupCondition))
      • Custom script: set udg_TempPlayer = Owner
      • Custom script: call ForGroup( Group, function SmokeGroupActions )
      • Custom script: call DestroyGroup ( Group )
      • Custom script: call RemoveLocation ( Point )
      • Custom script: set a = null
      • Custom script: set Owner = null
      • Custom script: set Point = null
      • Custom script: set Owner = null
      • Custom script: set Group = null
      • Custom script: set Rotation = 0
      • Wait 2.00 seconds
      • Custom script: set Count = 1
      • Custom script: loop
      • Custom script: exitwhen Count > 12
      • Custom script: call DestroyEffectBJ ( SE[Count] )
      • Custom script: set SE[Count] = null
      • Custom script: set Count = Count + 1
      • Custom script: endloop
      • Custom script: call DestroyEffectBJ(SEa)
      • Custom script: set SEa = null
      • Custom script: set SET = null
      • Custom script: set SETa = null
      • Custom script: set SP = null
and the map custom scripts field, the one one the top
JASS:
function SmokeGroupCondition takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function SmokeGroupActions takes nothing returns nothing
    local location PickPoint
    local player Owner
    local real Rotation
    local unit P
    set P = GetEnumUnit()
    set Rotation = GetCameraField(CAMERA_FIELD_ROTATION)
    set Owner = udg_TempPlayer
    set PickPoint = GetUnitLoc(P)
    call CreateNUnitsAtLoc( 1, 'h005', Owner, PickPoint, Rotation )
    call IssueTargetOrderBJ( GetLastCreatedUnit(), "curse", P )
    call RemoveLocation ( PickPoint)
    set PickPoint = null
    set P = null
    set Owner = null
    set Rotation = 0
endfunction

Anyone have an idea on how to fix this, please tell me :) THX
+rep will be given
 
Level 3
Joined
Sep 11, 2008
Messages
58
You should convert it to script text first... Would make it easier to read for us, and particularely for you to work with it. Looks like lots of work the way you did it.
 
Level 18
Joined
Oct 18, 2007
Messages
930
Fixed almost everything

ok fixed almost everything but this one is still bad...
JASS:
local effect array SE
loop
    exitwhen Count > 12
    call AddSpecialEffectLoc( AnyLocation, "anyeffect.mdl" )
    set SE[Count] = GetLastCreatedEffectBJ()
    set Count = Count + 1
endloop
i get a "String" error at the
JASS:
set SE[Count] = GetLastCreatedEffectBJ()
but why?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
JASS:
native AddSpecialEffectLoc takes string modelName,location where returns effect
You got the 2 paramets mixed up.

should be.
JASS:
call AddSpecialEffectLoc( "anyeffect.mdl",AnyLocation )

Normal WE often bugs and returns the error in the line below where the actual error was. JNGP can be used to get not only better error reasons but also more accurate line reports.

Also do what the above poster said as well as otherwise it will not work as GetLastCreatedEffectBJ() does not work with natives.
 
Status
Not open for further replies.
Top