Map Database  •  FAQ  •  RSS  •  Register  •  Login

New Dynamic Script Ideas

<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 23 Feb 2014, 01:39

Re: New Dynamic Script Ideas

RandomLyrics wrote:States.HouseUncloked(aPlayer, aType: integer) - returns true if specific player can build specific type.
i have question, is it will be okay with lag if i repeat 6 times ~80 actions.overlaytext every 1 sec? for now i have only 1 repeat but i need it to be changed.

HouseUncloked sounds useful, I put it on the script suggestions list.

You'd have to test it yourself to see whether it will cause lag. Try running the game on x10 speed and see if it's still smooth. My guess is it will be fine. You can make it run less often with "if States.GameTime mod 10 = 0 then" or similar if necessary.

Ben wrote:Hey, how's the progress on highlighting buttons/commands? I'd very much like them to make a better tutorial! :D

I put it on the script suggestions list, thanks for reminding me.
<<

Guest

Post 15 Mar 2014, 15:19

Re: New Dynamic Script Ideas

Hi,
would it be possible to add States.IsSpectator(playerID) please ?
That'd be very useful I think.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 19 Mar 2014, 21:08

Re: New Dynamic Script Ideas

Guest wrote:Hi,
would it be possible to add States.IsSpectator(playerID) please ?
That'd be very useful I think.

No, spectators are not in the same player list as the ones you can access from the script. The script only sees the map locations, and spectators can't influence the game in any way and are not assigned a map location. In terms of sending messages and displaying overlay text to spectators, this might not be properly implemented yet. But the idea is that they will see the overlay for the current player they are spectating. Perhaps we should add a way to set the overlay text for spectators? Currently -1 means all players, so -2 could mean all spectators. Then the script author can choose to override what the spectator sees by setting the overlay text with player=-2 after doing it for the real players, but if the script author doesn't do that the spectators will see the display for the player they are currently spectating.
<<

Guest

Post 19 Mar 2014, 23:29

Re: New Dynamic Script Ideas

That'd be neat if you could implement that, thanks. We could add some interesting overlay information to spectators !

I guess it would not be possible to have a way to set the "cinematic mode" for spectators ? It's much less important than text, obviously, and I'd understand if it wasn't done, but it'd open interesting possibilities.
<<

sado1

User avatar

Council Member

Posts: 1408

Joined: 21 May 2012, 19:13

KaM Skill Level: Skilled

Post 20 Mar 2014, 07:54

Re: New Dynamic Script Ideas

^ the guy above is French, look at how he writes the spaces before exclamation marks :P

Would be nice if we were able to see both spectator overlay, and player overlay. Maybe an option to unselect a player somehow? ("Choose a player..." on the player list?)
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 27 Mar 2014, 23:23

Re: New Dynamic Script Ideas

Actions.PingMinimap(aPlayer, X, Y: integer) - pings minimap at specific location (color of ping same as players color) - looks like normally ping in multiplayer.
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 07 Apr 2014, 10:44

Re: New Dynamic Script Ideas

Event OnHousePlanRemoved(aPlayer, aType, X, Y: integer);
Event OnRoadVineFieldPlanRemoved(aPlayer, X, Y: integer);
Actions.AddRoad(aPlayer, X, Y: integer); - add finished road
Actions.AddVine(aPlayer, X, Y: integer);
Actions.AddField(aPlayer, X, Y: integer);
<<

Skypper

User avatar

Knight

Posts: 436

Joined: 28 Jun 2013, 09:37

Location: Dutch :D

KaM Skill Level: Fair

Post 09 Apr 2014, 13:25

Re: New Dynamic Script Ideas

States.GetHost() returns the loc of the host player
Greets Skypper (Totally Insane)

- Beginning map maker -
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

Location: Russia

KaM Skill Level: Beginner

Post 24 Apr 2014, 11:19

Re: New Dynamic Script Ideas

From skype discussions:

- States.ClosestHouse/Unit/Group should have new parameter, type of house, unit etc. Example: Actions.HouseAddDamage(States.ClosestHouse(0, 11, 27, 26), 200); //add damage=200 to closest from point (26, 27) STOREHOUSE

- strange but:

Actions

MapObjectAdd(X,Y,Type)
MapObjectDelete(X,Y)
MapTileChange(X,Y,Type)
MapTileBlock(X,Y)

States

MapTileType(X,Y)
MapTileIsWalkable(X,Y)
MapTileIsGoodForCorn(X,Y)
...
can be continued :D

- Event OnMarketTrade, Action MarketTradeStart(player, from, to, count: Integer)

- more options for AI: defend allies, auto attack range, start position...
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 26 Apr 2014, 08:17

Re: New Dynamic Script Ideas

andreus wrote:- States.ClosestHouse/Unit/Group should have new parameter, type of house, unit etc. Example: Actions.HouseAddDamage(States.ClosestHouse(0, 11, 27, 26), 200); //add damage=200 to closest from point (26, 27) STOREHOUSE

That sounds good, and I have an extension to your idea: Let's make the type a set, so you can specific multiple types that should be accepted :) For example, to make a group attack the nearest storehouse, barracks, school or inn (closest house which is one of those types), use:
Actions.GroupOrderAttackHouse(States.ClosestHouse(0, 110, 120, [11, 21, 13, 27]), MyGroup);
I think that would be useful in some situations, and it's not hard to implement.

andreus wrote:MapObjectAdd(X,Y,Type)
MapObjectDelete(X,Y)
MapTileChange(X,Y,Type)
MapTileBlock(X,Y)

We want to support dynamic map changing, but we need to be careful because it would be very easy to crash the game if you block a unit or something. We'll probably just make the actions fail (return false) if executing them would cause the game to crash. So they could be used in situations where you know there will not be any units around to be blocked.

andreus wrote:MapTileType(X,Y)
MapTileIsWalkable(X,Y)
MapTileIsGoodForCorn(X,Y)

We'll probably add these things when we add the actions for editing the map.

andreus wrote:- Event OnMarketTrade, Action MarketTradeStart(player, from, to, count: Integer)

Good idea, we'll add these:
OnMarketTrade(aMarket, aFrom, aTo)
Actions.MarketTradeSet(aMarket, aFrom, aTo, aAmount)
States.MarketValue(aResource)

andreus wrote:- more options for AI: defend allies, auto attack range, start position...

Accepted.


EDIT: I want to remove OnUnitWounded, since wounds (hit points) are a hidden gameplay mechanic and there is no other way to interact with them at all. I don't see a time where OnUnitWounded would be useful. Any objections to me removing it?
<<

sado1

User avatar

Council Member

Posts: 1408

Joined: 21 May 2012, 19:13

KaM Skill Level: Skilled

Post 26 Apr 2014, 12:05

Re: New Dynamic Script Ideas

Lewin wrote:EDIT: I want to remove OnUnitWounded, since wounds (hit points) are a hidden gameplay mechanic and there is no other way to interact with them at all. I don't see a time where OnUnitWounded would be useful. Any objections to me removing it?

Yes, I object. I don't have many precise ideas so far, but I know detecting a hit might be useful, maybe if I try to change units stats in a dumb way for some kind of script? Like, when I'd want to replace builtin health with overlay-based hitpoints... Actually, even my (and Shad's) old idea for HoMM-like gameplay might require this for nice fight animations (when OnUnitWounded happens, replace the attacking (or defending) unit with an allied unit, so it stops fighting and gives just 1 hit - I dunno how to deal with missed hits though)
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 26 Apr 2014, 12:48

Re: New Dynamic Script Ideas

Lewin wrote:EDIT: I want to remove OnUnitWounded, since wounds (hit points) are a hidden gameplay mechanic and there is no other way to interact with them at all. I don't see a time where OnUnitWounded would be useful. Any objections to me removing it?

Me too :P its good event, i have some map using that :> and its will be usefull in future, when more scripts will be available.
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

Location: Russia

KaM Skill Level: Beginner

Post 26 Apr 2014, 13:20

Re: New Dynamic Script Ideas

agree with sado and RandomLyrics ;)
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 26 Apr 2014, 21:52

Re: New Dynamic Script Ideas

Ok, OnUnitWounded can stay then.

EDIT: I forgot to reply to these old posts:
sado1 wrote:Would be nice if we were able to see both spectator overlay, and player overlay. Maybe an option to unselect a player somehow? ("Choose a player..." on the player list?)

I've made it so spectators/replays see the overlay for the selected player, which is nice because you might want to check each player's individual scores in certain scripts. Is it still important to have a separate overlay for the spectator? The only example I can think of is in scripts like Fun with Flags where players can hide the overlay using the repair button in their storehouse, but spectators have no control over this. But a better solution to that is to implement a proper way to hide the overlay which only affect's the player's view of it.

Skypper wrote:States.GetHost() returns the loc of the host player

That won't really work since the host can be changed when returning to the lobby or loading a save (and for the replay we'd have to keep track of who was host at each moment in time so the script always runs the same...) What do you want it for anyway? Once the game starts the host is treated the same as any other player (no special powers).

RandomLyrics wrote:Actions.PingMinimap(aPlayer, X, Y: integer) - pings minimap at specific location (color of ping same as players color) - looks like normally ping in multiplayer.

So it looks like the player himself placed the beacon? I guess we can do that. I added it to the proposals list.

RandomLyrics wrote:Event OnHousePlanRemoved(aPlayer, aType, X, Y: integer);
Event OnRoadVineFieldPlanRemoved(aPlayer, X, Y: integer);
Actions.AddRoad(aPlayer, X, Y: integer); - add finished road
Actions.AddVine(aPlayer, X, Y: integer);
Actions.AddField(aPlayer, X, Y: integer);

Added to the proposals list.
<<

Skypper

User avatar

Knight

Posts: 436

Joined: 28 Jun 2013, 09:37

Location: Dutch :D

KaM Skill Level: Fair

Post 27 Apr 2014, 09:36

Re: New Dynamic Script Ideas

Lewin wrote:
Skypper wrote:States.GetHost() returns the loc of the host player

That won't really work since the host can be changed when returning to the lobby or loading a save (and for the replay we'd have to keep track of who was host at each moment in time so the script always runs the same...) What do you want it for anyway? Once the game starts the host is treated the same as any other player (no special powers).


I needed this script for my map Town Defence MP.
I wanted to let the host set the options, but you can't know witch loc the host is.
So now I let loc1 choose the options
Greets Skypper (Totally Insane)

- Beginning map maker -
PreviousNext

Return to Ideas / Suggestions

Who is online

Users browsing this forum: No registered users and 4 guests

cron