[JASS] Hello all! - Help would be appreciated

Status
Not open for further replies.
Level 2
Joined
Feb 25, 2017
Messages
7
Hello there; I'm "Replicator". I am new to this website (First post actually.) and to the Editor itself (Never really getting into map-making in the past). I would like some assistance with Triggers; most prominently Custom Races.


Yes; I have seen a few posts whilst scrolling about for help. But no, they did not work or I couldn't figure out how to do it. So here we go...



I've made a custom race, Hovrinnas; Yadah-Yadah. I can't get the generic triggers working.
like " call MeleeInitVictoryDefeatCustomized() "
I didn't/couldn't figure out/get it working. It gives me a Script Error of it expecting a name or something.

Here; it says " Expected a function name ". I'm not sure if it's asking for the Variable mentioned in the answer that replaced the Reveal text; or anything for that matter.

--

Then we have the start. I would like to have them spawn in and either choose a handicap on a race to choose their race (Which I have no clue how to do! This is the most preferred solution!). Or spawn in and choose in game (Which I only have a vague idea on how to do this; because of the previously mentioned troubles.)

--

But also consider; I want other players to be able to choose custom or go vanilla in their race choices and have no repercussions for doing so.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
I've made a custom race, Hovrinnas; Yadah-Yadah. I can't get the generic triggers working.
like " call MeleeInitVictoryDefeatCustomized() "
I didn't/couldn't figure out/get it working. It gives me a Script Error of it expecting a name or something.

Here; it says " Expected a function name ". I'm not sure if it's asking for the Variable mentioned in the answer that replaced the Reveal text; or anything for that matter.
It means your JASS script has a syntax error. Without the map or even an extract of the script/triggers it is impossible to tell what the cause is.

As a very rough guess it is because you are trying to call a function that has not yet been declared. You can only call functions declared above the call site.

Then we have the start. I would like to have them spawn in and either choose a handicap on a race to choose their race (Which I have no clue how to do! This is the most preferred solution!). Or spawn in and choose in game (Which I only have a vague idea on how to do this; because of the previously mentioned troubles.)
Use in game dialogs for race selection. In WC3 there is no practical way to add or modify the race pulldown choices inside the lobby. The lobby handicap should work in game as expected unless it is explicitly set for a player using triggers.

After the player has made a selection, remove any default buildings they may have and replace them with the appropriate race buildings. Efficiency of this does not matter so you can pick all units on the map and filter for player and type. There is a GUI function to get all units of a player or all units of type for a player but I recall those suffering a handle index leak.
 
@Replicator

call MeleeInitVictoryDefeatCustomized()

Have you declared a function with that name? If not, you must declare a function with the name you placed and place the function in the Map script.

To declare a function, one must type this:

JASS:
function funcname takes nothing returns nothing
endfunction

- funcname can take any name that you will assign, as long as it is a valid name.

takes nothing
- the arguments needed by the function to execute its' contents. It can take many types but that will be discussed in another message. In this case, it takes no argument.

returns nothing
- the type returned by the function. In this case, it will return nothing.

Now, if you have JNGP or Warcraft III WEX, you can look for the function in the function list. Look for MeleeInitVictoryDefeat and copy its' contents. Declare a function named MeleeInitVictoryDefeatCustomized in the map script.

If you don't have either of these, you will have to use an external tool to view the blizzard.j file that contains the base function.
 
Status
Not open for further replies.
Top