Error Help

D359

Member
Reaction score
1
I keep geting this error on a triger:Expected a function name.What dose it mean and how do I fix it?On a testmap this error worked fine,but when I copy pasted the triger on to my map,it stoped working.

Here is the triger
Trigger:
  • Events
    • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Beastmastery
    • Actions
      • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(),true,GetLearnedSkillBJ())
      • Custom script: call MakePermanent( GetTriggerUnit() )
 

D359

Member
Reaction score
1
If I don't have a separate library what do I have to do to make the triger work.This triger was made for me by someone.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
They either used a library where MakePermanent(unit whichUnit) is an added function;
Or they just used something that doesn't exist. Could you link the previous thread maybe?

Why do you need to try and make a unit permanent anyways?
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You didn't give us the whole trigger.
Code:
-------- <-----------Click on Permanence.w3x. --------
Did you do this?
It contains the script you need to make this work.
JASS:
// I found out that making a spellbook permanent does nothing to the spells inside it.
// Apparently, you need to make the spells inside permanent as well.
// So, instead of writing multiple Custom Script lines, which takes more time, I made it a bit easier by adding this (not so) little function.

// =============================================================================================================
function MakePermanent takes unit WhichUnit returns nothing
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;ACbb&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;Aclf&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;Suhf&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;ACat&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;Asps&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;AEer&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;Adis&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;Aroa&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;ACcs&#039;)
    call UnitMakeAbilityPermanent(WhichUnit,true,&#039;SCc1&#039;)
endfunction
// =============================================================================================================

// The actual function goes like this: call UnitAbilityMakePermanent(NAME,true,ABILID)
// NAME is the unit reference. In our case, GetTriggerUnit().
// It can be something else, but make sure the reference is something like gg_unit_Nbst_0001.
// A unit-type rawcode, which is what Nbst is, doesn&#039;t fit and will cause problems here.
// The next part, true, means to make it permanent. You can make an ability not permanent by changing this to false.
// ABILID is the rawcode of the ability. In our case, GetLearnedSkillBJ() works, since it&#039;s an Event Response of the suitable type.
// When you don&#039;t have such an Event Response to use, you need to fit the ability&#039;s actual rawcode in quotation marks.
// The above lines are an example.

// =============================================================================================================
// Importing this system into your map:

// Don&#039;t change the first line and last line (the ones that start with &quot;function&quot; and &quot;endfunction&quot;. Copy those exactly.
// Copy the following line, replacing XXXX with the ability IDs of all the abilities in your spellbook. Don&#039;t put the slashes //.
//     call UnitMakeAbilityPermanent(WhichUnit,true,&#039;XXXX&#039;)
// Make sure to do it one by one, not all in one big lump.
// To use it, just call it the way I did in the Learn trigger. (&quot;call MakePermanent(GetTriggerUnit()&quot;)
 

D359

Member
Reaction score
1
What the?I need jass to make it work?I didn't see that because I didn't know it was made in jass!Damn and I thought that coment was irelevant.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
The GUI trigger told you to look in the map header :p
Code:
-------- <-----------Click on Permanence.w3x. --------
Make sure to post whole triggers for things like this, we need all we can get to help you :)

Also, UnitMakeAbilityPermanent is JASS, and you use it (In the form of a custom script).
 

WolfieeifloW

WEHZ Helper
Reaction score
372
What? You mean the code from the map header?
In the Trigger Editor, at the very top of the left-side tree, there's the name of your map;
Permanence.w3x
Click on that and the code is in there.
 

D359

Member
Reaction score
1
When I posted that,it didn't cross my mind to check it with jass because at first kaerf was sure that what he did in jass could have been made with custom script only.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
When did I ever say something like that? :confused: If I did, I'm sure I wasn't reading what I typed - that happens a lot. :banghead:

Custom Script == One line of JASS code. Which is just enough to call a function, but not enough to create one. Or to insert important guidelines/comments. That's why I put it into the map header, a.k.a. Permanence.w3x instead. :p

My apologies to D359 for not being able to reply to you in time. I guess it must have been really :nuts: confusing.

Also, my thanks to WolfieeifloW for laying it out. :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top