Map Database  •  FAQ  •  RSS  •  Login

Dynamic Script Usage Questions

<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 24 Feb 2015, 11:36

Re: Dynamic Script Usage Questions

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.
<<

Esthlos

User avatar

Knight

Posts: 676

Joined: 23 Jun 2013, 16:02

KaM Skill Level: Beginner

Post 24 Feb 2015, 11:46

Re: Dynamic Script Usage Questions

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?
Just when you think you know something, you have to look at it in another way, even though it may seem silly or wrong. You must try! - John Keating, "Dead Poets Society"
<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 24 Feb 2015, 11:58

Re: Dynamic Script Usage Questions

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.
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 24 Feb 2015, 14:10

Re: Dynamic Script Usage Questions

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
<<

kocsis1david

Crossbowman

Posts: 204

Joined: 12 Mar 2011, 23:00

KaM Skill Level: Skilled

Location: Hungary

Post 24 Feb 2015, 14:25

Re: Dynamic Script Usage Questions

Units might be an explanation. Object's tile would be marked as red X when searching place for the building plan.
<<

Vatrix

User avatar

Council Member

Posts: 410

Joined: 19 Apr 2013, 20:30

KaM Skill Level: Veteran

Location: Czech Republic

Post 11 Aug 2015, 17:34

Re: Dynamic Script Usage Questions

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
You do not have the required permissions to view the files attached to this post.
I fixed The Shattered Kingdom and The Peasants Rebellion here!
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 11 Aug 2015, 17:41

Re: Dynamic Script Usage Questions

@Vatrix: IIRC you need to set FOW sharing to be only 1-way. Do not share the AIs FOW with the player back.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Vatrix

User avatar

Council Member

Posts: 410

Joined: 19 Apr 2013, 20:30

KaM Skill Level: Veteran

Location: Czech Republic

Post 11 Aug 2015, 17:45

Re: Dynamic Script Usage Questions

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?
I fixed The Shattered Kingdom and The Peasants Rebellion here!
<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 11 Aug 2015, 17:55

Re: Dynamic Script Usage Questions

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;
<<

Vatrix

User avatar

Council Member

Posts: 410

Joined: 19 Apr 2013, 20:30

KaM Skill Level: Veteran

Location: Czech Republic

Post 11 Aug 2015, 18:06

Re: Dynamic Script Usage Questions

Nope it just covers all in fog.
I fixed The Shattered Kingdom and The Peasants Rebellion here!
<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 11 Aug 2015, 18:14

Re: Dynamic Script Usage Questions

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?
<<

Vatrix

User avatar

Council Member

Posts: 410

Joined: 19 Apr 2013, 20:30

KaM Skill Level: Veteran

Location: Czech Republic

Post 11 Aug 2015, 18:16

Re: Dynamic Script Usage Questions

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.
I fixed The Shattered Kingdom and The Peasants Rebellion here!
<<

thibmo

User avatar

Council Member

Posts: 124

Joined: 03 Aug 2015, 09:12

KaM Skill Level: Skilled

Website: https://kp-wiki.org/

Location: the Netherlands

Post 11 Aug 2015, 18:27

Re: Dynamic Script Usage Questions

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.
~~ The magic wizard of PascalScriptus. ~~

KP-Wiki :
  • Information about Knights Province scripting ( unofficial )
  • Information about several hosting/server maintenance basics
  • Other random stuff
<<

Vatrix

User avatar

Council Member

Posts: 410

Joined: 19 Apr 2013, 20:30

KaM Skill Level: Veteran

Location: Czech Republic

Post 11 Aug 2015, 18:32

Re: Dynamic Script Usage Questions

That does not do what I want :( . Look into fast chat for more info.
I fixed The Shattered Kingdom and The Peasants Rebellion here!
<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 11 Aug 2015, 18:37

Re: Dynamic Script Usage Questions

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

Return to “Dynamic Scripting”

Who is online

Users browsing this forum: No registered users and 10 guests