Variable help

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
xHPx
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Variable help

Unread post by xHPx »

Hey,

on my map I have used some TFT-only triggers, but I want the map to be RoC-playable. Usually this would be solved by just converting them to Jass, but then it says:
- Expansion-only trigger functions, types, or values are being used (Trigger Editor)
I guess this is because of the trigger variables, but when I remove them I get several errors like this:
Line xx: Expected a variable name.
Any help would be appreciated. Thanks.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Variable help

Unread post by 3ICE »

It would help if you told us about your actual problem. All you said was that removing a variable causes errors, we know that. Don't remove variables that you use!
I would rather not write an entire book for you on how to debug JASS, so find which trigger causes it, post it here and I will debug it for you.

EDIT:
How to find which category causes errors:
Step 0: Create a copy of your map and open it. - We will be doing irreversible damage to it so it is better to save a backup rather than rely on the limited undo function.
Step 1: Delete a category.
Step 2: See if there are any errors.
Step 3: Repeat steps 1 and 2 until there are no errors.
Step 4: Click undo and the category that gets restored was the culprit.

How to find which trigger causes errors:
Step 0: Create a copy of your map and open it. - We will be doing irreversible damage to it so it is better to save a backup rather than rely on the limited undo function.
Step 1: Delete a trigger.
Step 2: See if there are any errors.
Step 3: Repeat steps 1 and 2 until there are no errors.
Step 4: Click undo and the trigger that gets restored was the culprit.

How to find which trigger action causes errors:
Step 0: Create a copy of your trigger and select it. - We will be doing irreversible damage to it so it is better to save a backup rather than rely on the limited undo function.
Step 1: Delete a trigger action.
Step 2: See if there are any errors.
Step 3: Repeat steps 1 and 2 until there are no errors.
Step 4: Click undo and the trigger action that gets restored was the culprit.
ImageImageImageImageImage
Image
ImageImage

xHPx
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

Unread post by xHPx »

Here's one of the errors:
Line 34: Expected avariable name
The code:
set udg_Destructables[1] = 'LTlt'
They pop up when I remove the variables. Do I have to declare them within Jass if I remove them from the GUI? If so, how?

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Variable help

Unread post by 3ICE »

3ICE wrote:Don't remove variables that you use!
Pay attention much?
3ICE wrote:How to find which category causes errors:
Step 0: Create a copy of your map and open it. - We will be doing irreversible damage to it so it is better to save a backup rather than rely on the limited undo function.
Step 1: Delete a category.
Step 2: See if there are any errors.
Step 3: Repeat steps 1 and 2 until there are no errors.
Step 4: Click undo and the category that gets restored was the culprit.

How to find which trigger causes errors:
Step 0: Create a copy of your map and open it. - We will be doing irreversible damage to it so it is better to save a backup rather than rely on the limited undo function.
Step 1: Delete a trigger.
Step 2: See if there are any errors.
Step 3: Repeat steps 1 and 2 until there are no errors.
Step 4: Click undo and the trigger that gets restored was the culprit.

How to find which trigger action causes errors:
Step 0: Create a copy of your trigger and select it. - We will be doing irreversible damage to it so it is better to save a backup rather than rely on the limited undo function.
Step 1: Delete a trigger action.
Step 2: See if there are any errors.
Step 3: Repeat steps 1 and 2 until there are no errors.
Step 4: Click undo and the trigger action that gets restored was the culprit.
Did you even try doing all this? You need to find which trigger requires TFT!

EDIT: Using a destructible array doesn't require TFT. Post all your variables here and I will identify which one(s) do(es).
ImageImageImageImageImage
Image
ImageImage

xHPx
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

Unread post by xHPx »

  • Region
    Destructible-Type Array
    Int
    Player
    Int
    String
    Unitgroud
    Point
    Terrain Type Array
These are the variables. I know that terrain type array is TFT only, but there must be at least one other since it still says that it requires TFT after I delete it.

Also, how do I declare the variables in JASS? I tried this:

Code: Select all

globals
string array terrain
endglobals
For the terrain type array, but it just gave me an expected end of line error.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Variable help

Unread post by 3ICE »

"Unitgroud" is not a valid variable type. Install a spell checker addon!
You used the LIST bbcode incorrectly.
You are right about "Terrain Type Array". You can't use it in RoC through the GUI variable editor.

You can't declare globals in JASS without JASSHelper, because there is only one globals block per map, which isn't editable through the World Editor.

And strings have nothing to do with TerrainType, they are all integers.

Possible solution: Start using locals.
ImageImageImageImageImage
Image
ImageImage

xHPx
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

Unread post by xHPx »

I guess I'll have to merge all of the triggers together and use locals then. Thanks for the help :)

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Variable help

Unread post by 3ICE »

Why merge?

You are welcome.
ImageImageImageImageImage
Image
ImageImage

xHPx
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

Unread post by xHPx »

Because some of the variables are used by more than one trigger, and if they are local they are only avialable to that trigger. Or am I missing something?

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Variable help

Unread post by 3ICE »

xHPx wrote:Or am I missing something?
Yes you are.
Locals are not per-trigger, they are per-function. Merging does not help.

You are better off using JASSHelper. (Link is a couple posts above.)
ImageImageImageImageImage
Image
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests