Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: [Editor"MOD"]Heroes V Quest Editor
Thread: [Editor"MOD"]Heroes V Quest Editor This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted February 11, 2009 05:30 PM
Edited by Warmonger at 17:31, 11 Feb 2009.

...And where do you call function f_check? It won't trigger on its own, only commands present outside any functions do.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Asheera
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)
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Lepastur
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted February 11, 2009 05:47 PM
Edited by Warmonger at 17:57, 11 Feb 2009.

Nope, I mean the quest list /log / diary / scenario info or whatever it is called.

Oh, here it is:

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted February 11, 2009 07:35 PM

No change, apart from it's already five minutes later

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Asheera
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.
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted February 11, 2009 09:07 PM
Edited by Warmonger at 21:08, 11 Feb 2009.

Quote:
CAN'T not put

Asheera, you failed

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Asheera
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.
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Warmonger
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Asheera
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.
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Asheera
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)
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Asheera
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
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
TSoD
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Asheera
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>
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0424 seconds