• 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] Confusing Error

Status
Not open for further replies.
Level 7
Joined
Feb 25, 2007
Messages
286
What in the world is wrong with this?!!?!?
JASS:
function InitTrig_Untitled_Trigger001 takes nothing returns nothing
?!??!?
In Jass new gen pack it said it was wrong!!
And 1 quick question, how do you find the "raw code" of an ability?
It saids the function is redeclaired
Heres the whole function

JASS:
function InitTrig_Untitled_Trigger001 takes nothing returns nothing
    call OnAbilityEffect( rawcode(), actions() )
endfunction
 
Last edited:
Level 11
Joined
Feb 18, 2004
Messages
394
if it says the function is redeclared, its likely that there already is a function with that name...

rawcodes are integers. They are base 256, using ASCII to tie char glyphs to numbers. you declare a rawcode in code by encasing it in single quotes 'RawC' rawcodes are always 4 chars long. Press CTRL+D in the object editor to see raw codes.
 
Level 11
Joined
Aug 25, 2006
Messages
971
What do you mean? Generally you don't.

Why would you need to change it? All you have to do is find out what the ability's rawcode is and input that. Try and explain what your doing...
 
Level 11
Joined
Aug 25, 2006
Messages
971
As far as I've found, you have to make a new spell to change it. So technically you cant just change it. You have to copy it, type in the new code, then delete it. Also it remains unchangeable in-game.

Anyway thats why I say "generally you don't"
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
OnAbilityEffect what is this ?
Its not a warcraft 3 native so you cant use it without determining
not in World Editor or Jass NewGen Pack

man its a CSCache function
you cant use CSCache functions in your map without using CSCache

CSCache system is Cache data of Caster System
JassCraft can recognize it but World Editor cant
because JassCraft is registered with Caster System

How Will You Make It Then ?


There is a function named TriggerRegisterAnyUnitEventBJ we will use it

JASS:
function Untitled_Trigger001_Actions takes nothing returns nothing
// some actions here
endfunction

function InitTrig_Untitled_Trigger001_Conditions takes nothing returns boolean
return GetSpellAbilityId() == <YOUR ABILITY RAW CODE HERE>
endfunction

function InitTrig_Untitled_Trigger001 takes nothing returns nothing
  local trigger trig = CreateTrigger()
  call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddAction(trig,function Untitled_Trigger001_Actions)
  call TriggerAddCondition(trig,Filter(function InitTrig_Untitled_Trigger001_Conditions))
endfunction

This should work
 
Status
Not open for further replies.
Top