Page 25 of 26

Re: Dynamic Script Usage Questions

PostPosted: 24 Feb 2015, 11:36
by kocsis1david
On the plan placed event, I replace the plan with a built house. The problem is that give house fails where a player could place the plan. I don't know the reason and it's annoying.

Re: Dynamic Script Usage Questions

PostPosted: 24 Feb 2015, 11:46
by Esthlos
On the plan placed event, I replace the plan with a built house. The problem is that give house fails where a player could place the plan. I don't know the reason and it's annoying.
Does it always fail or only in some specific circumstances?

Re: Dynamic Script Usage Questions

PostPosted: 24 Feb 2015, 11:58
by kocsis1david
Not always fails, mostly it works. I haven't figured out what circumstances causes it to fail.

EDIT:
I tested it for some time, and the bug haven't occured since then. It's strange, because I haven't fixed it.

Re: Dynamic Script Usage Questions

PostPosted: 24 Feb 2015, 14:10
by RandomLyrics
Hmm it will not give house untill there will be space for it. u have to remove units/groups, objects etc. It works fine for me, i mean : removeplan > givehouse.
Check log.txt in KamRemake folder log for more information, maybe u give some bad values to the action script :P

Re: Dynamic Script Usage Questions

PostPosted: 24 Feb 2015, 14:25
by kocsis1david
Units might be an explanation. Object's tile would be marked as red X when searching place for the building plan.

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 17:34
by Vatrix
How to make a script to not share fog with ally from mission start?

I thought it should be like this:
  Code:
procedure OnMissionStart; begin //Disables Sharing Fog With Ally Actions.PlayerShareFog(0, 1, False); Actions.PlayerShareFog(1, 0, False); Actions.PlayerShareFog(0, 2, False); Actions.PlayerShareFog(2, 0, False); end;
KaM Remake 2015-08-11 19-28-23.jpg
But it results in this:
KaM Remake 2015-08-11 19-28-38.jpg

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 17:41
by Krom
@Vatrix: IIRC you need to set FOW sharing to be only 1-way. Do not share the AIs FOW with the player back.

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 17:45
by Vatrix
I don't think so,
This is working script from TSK07
  Code:
procedure OnMissionStart; begin //Disables Sharing Fog With Ally Actions.PlayerShareFog(0, 4, False); Actions.PlayerShareFog(4, 0, False); end;
Maybe I'm missing something?[/color]

EDIT: No, it's also not working, maybe it's not possible to do that?

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 17:55
by Strangelove
I think I had that problem before. Try that:
  Code:
procedure OnMissionStart; begin Actions.PlayerShareFog(0, 4, False); Actions.PlayerShareFog(4, 0, False); Actions.FogCoverAll(0); end;

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 18:06
by Vatrix
Nope it just covers all in fog.

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 18:14
by Strangelove
Nope it just covers all in fog.
Yeah, ofc it does. I thought you wanted that? Sorry, I think I misunderstood something. So, you just want to stop sharing fog with allies, but still want to see what they have seen before you stopped sharing?

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 18:16
by Vatrix
I have some fog revealers in static script and I want to see only what those revealers revealed (you can look on them in mapED if you download TPR1) and not what my ally revealed on mission start.

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 18:27
by thibmo
I have some fog revealers in static script and I want to see only what those revealers revealed (you can look on them in mapED if you download TPR1) and not what my ally revealed on mission start.
Assuming the Player Id is "0":
  Code:
procedure OnMissionStart; begin //Disables Sharing Fog With Ally Actions.PlayerShareFog(1, 0, False); // Set fog share of player 1 to player 0 as false Actions.PlayerShareFog(2, 0, False); // Set fog share of player 2 to player 0 as false end;
In short this means that "hand id" 1 and 2 do not share their view with 0.
If this does not work then I am afraid there will be a lot more work required.

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 18:32
by Vatrix
That does not do what I want :( . Look into fast chat for more info.

Re: Dynamic Script Usage Questions

PostPosted: 11 Aug 2015, 18:37
by Strangelove
I have some fog revealers in static script and I want to see only what those revealers revealed (you can look on them in mapED if you download TPR1) and not what my ally revealed on mission start.
Hm, tried a couple of things, but nothing seems to be working. I seems like the vision from the allies is somehow applies before the OnMissionStart() procedure. However, I'll try something else and get back to you. :P