Page 15 of 24

Re: New Dynamic Script Ideas

PostPosted: 23 Feb 2014, 01:39
by Lewin
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.
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.

Re: New Dynamic Script Ideas

PostPosted: 15 Mar 2014, 15:19
by Guest
Hi,
would it be possible to add States.IsSpectator(playerID) please ?
That'd be very useful I think.

Re: New Dynamic Script Ideas

PostPosted: 19 Mar 2014, 21:08
by Lewin
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.

Re: New Dynamic Script Ideas

PostPosted: 19 Mar 2014, 23:29
by Guest
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.

Re: New Dynamic Script Ideas

PostPosted: 20 Mar 2014, 07:54
by sado1
^ 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?)

Re: New Dynamic Script Ideas

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

Re: New Dynamic Script Ideas

PostPosted: 07 Apr 2014, 10:44
by RandomLyrics
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);

Re: New Dynamic Script Ideas

PostPosted: 09 Apr 2014, 13:25
by Skypper
States.GetHost() returns the loc of the host player

Re: New Dynamic Script Ideas

PostPosted: 24 Apr 2014, 11:19
by andreus
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...

Re: New Dynamic Script Ideas

PostPosted: 26 Apr 2014, 08:17
by Lewin
- 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.
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.
MapTileType(X,Y)
MapTileIsWalkable(X,Y)
MapTileIsGoodForCorn(X,Y)
We'll probably add these things when we add the actions for editing the map.
- 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)
- 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?

Re: New Dynamic Script Ideas

PostPosted: 26 Apr 2014, 12:05
by sado1
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)

Re: New Dynamic Script Ideas

PostPosted: 26 Apr 2014, 12:48
by RandomLyrics
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.

Re: New Dynamic Script Ideas

PostPosted: 26 Apr 2014, 13:20
by andreus
agree with sado and RandomLyrics ;)

Re: New Dynamic Script Ideas

PostPosted: 26 Apr 2014, 21:52
by Lewin
Ok, OnUnitWounded can stay then.

EDIT: I forgot to reply to these old posts:
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.
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).
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.
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.

Re: New Dynamic Script Ideas

PostPosted: 27 Apr 2014, 09:36
by Skypper
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