~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  

Share | 
 

 [Ironfist ver 1.3.0] Bug with Teleport in lua script

Go down 
AuthorMessage
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2018-09-06, 05:45

Load: "GRWar2.MX2"

Play the blue player.
Click the "OKAY" button and end the turn (the program seems blocked, but it is not, the waiting time lasts about 15 seconds, it's the autosave file of the scenario).
Part of the purple player's fog of war is removed.

Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-01, 18:02

For convenience, can you paste the script that you used here?
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-02, 03:24

Hello Darmani,

Scenario and script: GRWar2.7z

The lua script contains only this code:

Code:
function OnNewDay(month, week, day)
  MessageBox("Hello");
  player = GetPlayer(0);
  hero = GetHero(player, 0);
  TeleportHero(hero, 126, 133);
end;
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-02, 12:44

The player is purple, and blue is the hero being teleported, right? I think I see how this is happening.
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-03, 03:47

In the example, you must play the blue player, human player, player "0". The first hero of the blue player is teleported. Part of the violet player's fog of war is unveiled.
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-03, 17:10

How can you tell? Is the violet player also human?

Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-04, 07:35

I can tell because it's a solo game. I chose the blue player against all other AI players, so the purple player is an AI player. I wrote the script so that the first hero of the blue player is teleported. Smile
Why not just try it? It will take less than a minute and fifteen seconds. Very Happy
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-04, 08:15

...you said that the purple player's fog of war is removed, right? Do you mean that part of the blue player's fog of war is removed, but of an area showing the purple player?

The link to the savegame is broken, so I can't try it.
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-04, 08:58

The link in the third post works, this one.

Play the blue player, the purple player is an IA player.
At the beginning of the scenario, the script is executed.
Just press the "Okay" button of the "Hello" window that appears, it is part of the script, the first hero of the blue player is teleported by the script. Then press the "Okay" buttons of the "Bonus" windows that appear, they are part of the original scenario, not the script.
Until then, everything is normal, the fog of war of the blue player, the one you play, is removed normally.
Pass the turn.
Wait about 15 seconds for the game to give you the hand, the program seems stuck, but it is not the case, it's the waiting time, quite annoying, for the automatic save file of the scenario to take place.
Once again the "Hello" window of the script appears, just press the "Okay" button.
Now, look in the upper left corner of the minimap, part of the purple player's fog of war, one of the AI players, is removed. Smile
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-04, 16:21

Ah. Sorry for missing that. Thanks for switching to Google Drive; it's a friendlier option for this sort of thing.

Bug confirmed. Holy crap.
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-04, 17:49

The bug was related to calling TeleportHero from OnNewDay. For some reason, the game will reveal a map area around the current *viewing port* when you teleport a hero (we use the same function as portals and the Dimension Door spell). On the second day, the current viewing port is set by whichever player went last.

I have committed a fix.
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   2019-01-05, 04:24

Yes, Google Drive is more sustainable in time. Smile
Thanks for the explanation and fix.
Back to top Go down
Sponsored content




PostSubject: Re: [Ironfist ver 1.3.0] Bug with Teleport in lua script   

Back to top Go down
 
[Ironfist ver 1.3.0] Bug with Teleport in lua script
Back to top 
Page 1 of 1
 Similar topics
-
» [Ironfist ver 1.2] scrXXXX.tmp files
» Some Ironfist changes I am working on
» [Ironfist ver 1.2] Crash with AUTOSAVE
» Translation script
» embed Script code in forum? (

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Modding Guild :: Heroes of Might and Magic II: Project Ironfist :: Bug Reports-
Jump to: