• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[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,202
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