|
Thread: [Editor"MOD"]Heroes V Quest Editor | This thread is pages long: 1 2 3 4 5 6 · «PREV / NEXT» |
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 11, 2009 05:20 PM |
|
|
Hello all
I have a question :
My code is correct, but nothing happens when Nathaniel (=Ellaine) have 20 peasants and 20 archers.
And also, nothing happens when the I capture town1... I tried to remove the condition and its 'end' for this function, but it is all the same...
There is the code :
Thanks for response, cause I'm stucked else :s
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted February 11, 2009 05:30 PM |
|
|
...And where do you call function f_check? It won't trigger on its own, only commands present outside any functions do.
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 11, 2009 05:37 PM |
|
|
You have to use the startThread function at the end, otherwise it will get stuck in that function forever.
startThread(f_check__Army_Assembled0)
____________
|
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 11, 2009 05:45 PM |
|
Edited by TSoD at 17:45, 11 Feb 2009.
|
I found the errors -_-
-We CAN'T not put a ';' after a function like GiveExp (then functions that aren't from the Script Functions editor manual).
-I believed that when I captured the town there were no award given. But yes there is, it's only that the game does not display a floating text like '+1 [offence icon]'...
Have you a function to change stats of a hero but in showing this floating text ?
->EDIT : plus what Asheera said
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Lepastur
Known Hero
The Red Taskmaster
|
posted February 11, 2009 05:45 PM |
|
|
Quote: Currently under testing, I have about a hundred of quests to add
EDIT: After rolling files back to the map, game displays only empty labels where the objective names should be. And YES, I added their name and desciption.
Truly saying, description is all I need now, as scripts have been written some months ago
Now, why the ditor doesn't show any objectives at all in the map panel? Or I can't find them?
Are you meaning about the white square (Capture Object Quest) issue?
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted February 11, 2009 05:47 PM |
|
|
Nope, I mean the quest list /log / diary / scenario info or whatever it is called.
Oh, here it is:
|
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 11, 2009 07:22 PM |
|
|
I KNOW I KNOW !
The text files of the game (I mean the .txt one ONLY, not XDB and LUA) are encoded in UNICODE and not ANSI.
TO remediate to this : Open your text file with the notepad->Save As...->select the UNICODE encoding in the combo box that says 'ANSI'->Save
There you are
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted February 11, 2009 07:35 PM |
|
|
No change, apart from it's already five minutes later
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 11, 2009 08:34 PM |
|
|
Quote: -We CAN'T not put a ';' after a function like GiveExp (then functions that aren't from the Script Functions editor manual).
That's why it's better to not place any semicolons at all, except when writing multiple commands on one line.
____________
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted February 11, 2009 09:07 PM |
|
|
Quote: CAN'T not put
Asheera, you failed
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 11, 2009 09:13 PM |
|
Edited by Asheera at 21:15, 11 Feb 2009.
|
Nope, I never used semicolons in my scripts and I never got any error whatsoever, and I think I used GiveExp a bit
And btw, you don't need to put the if condition in parentheses either, because you have a then at the end (of course, parentheses are still used to make complex expressions and such, you just don't need an overall parentheses to link the entire if statement)
EDIT: Simple test: use the console, write @GiveExp("heroname", 10000)
and see that it works, without any semicolon at all.
____________
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted February 11, 2009 09:21 PM |
|
|
I always use the console without semicolon tbh.
Ok, thanks for the info. Will try this on my new map, but first have to finish current one and that is why I asked for help with quests
|
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 14, 2009 12:10 PM |
|
|
Has anyone an idea to set up a 'Defeat All' objective in LUA when we have only one information : the player who must kill the others ?
I thought about the GatPlayerState function, or of two conditions :
1°) GetPlayerState(the specified player) == ACTIVE
2°) [Count of remaining players = 1]
But I don't know the ID of player states, and I have no idea how to create this count...
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 14, 2009 02:49 PM |
|
|
Well you simply write the index of the player. GetPlayerState(1) will give you the state of player 1, while GetPlayerState(7) will give you the state of player 7, for example.
____________
|
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 14, 2009 08:00 PM |
|
Edited by TSoD at 20:00, 14 Feb 2009.
|
You misunderstood
I need something like :
(NB : comboBox7 contain the selected player who must defeat all)
if GetActivePlayersCount == 1 then
if GetPlayerState(this->comboBox7->SelectedIndex+1) == ACTIVE then
win();
else
loose();
end;
end;
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 15, 2009 03:48 PM |
|
|
Why not use the default "DEFEAT_ALL" objective type for this basic task?
Also, your code seems to be ok. And for calculating the remaining players count:
for i = 1, MAX_PLAYERS do
if GetPlayerState(i) == not nil then GetActivePlayersCount = GetActivePlayersCount + 1 end
end
MAX_PLAYERS can be set to 8, or to the max number of players on this map (to optimize it a bit)
____________
|
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 16, 2009 05:11 PM |
|
|
Yes but how do we get the MAX_PLAYER value ? GetPlayerNumber ?
Or MAX_PLAYER is a macro maybe ?
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 16, 2009 05:23 PM |
|
|
Well if you can't really get that number you could set it to 8.
But is there no way you could get that value from the specific map in question
____________
|
|
TSoD
Promising
Famous Hero
NCF Blacksmith
|
posted February 16, 2009 07:35 PM |
|
|
It is just what I asked how to get this count of players at the beginning of the game
____________
NCFBank,
the complete and homogen NCF
library.
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted February 16, 2009 08:33 PM |
|
|
Check the <players> property in the map.xdb file, and count the number of <Item> fields that have <ActivePlayer>true</ActivePlayer>
____________
|
|
|