Variable help

Do you need World Editor help? Ask here!
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)

Variable help

New postby xHPx on Tue Jun 23, 2009 12:02 pm

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.
xHPx
 
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

New postby 3ICE on Tue Jun 23, 2009 1:32 pm

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
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Variable help

New postby xHPx on Tue Jun 23, 2009 2:02 pm

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?
xHPx
 
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

New postby 3ICE on Wed Jun 24, 2009 7:06 am

3ICEDon't remove variables that you use!
Pay attention much?

3ICEHow 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
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Variable help

New postby xHPx on Wed Jun 24, 2009 7:50 am

    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.
xHPx
 
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

New postby 3ICE on Wed Jun 24, 2009 8:02 am

"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
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Variable help

New postby xHPx on Wed Jun 24, 2009 8:05 am

I guess I'll have to merge all of the triggers together and use locals then. Thanks for the help :)
xHPx
 
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

New postby 3ICE on Wed Jun 24, 2009 8:18 am

Why merge?

You are welcome.
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Re: Variable help

New postby xHPx on Wed Jun 24, 2009 8:25 am

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?
xHPx
 
Posts: 7
Joined: Tue Jun 23, 2009 11:49 am

Re: Variable help

New postby 3ICE on Wed Jun 24, 2009 8:26 am

xHPxOr 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
User avatar
3ICE
Admin
 
Posts: 2359
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

Next

Return to HELP



Who is online

Users browsing this forum: Google [Bot] and 25 guests