Map Database  •  FAQ  •  RSS  •  Login

New Dynamic Script Ideas

<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 27 Apr 2014, 09:49

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.
So it looks like the player himself placed the beacon? I guess we can do that. I added it to the proposals list.
yep, i think better usefull will be when Actions.PingMinimap(aPlayer, X, Y: integer; Color: ansistring) - aPlayer, for what player beacon will be visible (-1, every one), Color - color of the beacon.
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
GetHost is hard, better set him default loc like Location 1, then player 1 i always needed.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 27 Apr 2014, 10:15

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.
So it looks like the player himself placed the beacon? I guess we can do that. I added it to the proposals list.
yep, i think better usefull will be when Actions.PingMinimap(aPlayer, X, Y: integer; Color: ansistring) - aPlayer, for what player beacon will be visible (-1, every one), Color - color of the beacon.
That sounds confusing, how will you tell the difference between a beacon from the script and a beacon of another player? (if the same color was used) I think beacons from the script should look different.
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
Unfortunately I think you'll have to leave it like that, GetHost isn't really possible to implement. Maybe just say in the map description that location 1 gets to set the options, then the host can choose it if he doesn't trust others.
<<

Skypper

Knight

Posts: 436

Joined: 28 Jun 2013, 09:37

KaM Skill Level: Fair

Location: Dutch :D

Post 27 Apr 2014, 10:23

Re: New Dynamic Script Ideas

Yeah I have it that way now, and I will leave it that way I think
Greets Skypper (Totally Insane)

- Beginning map maker -
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 27 Apr 2014, 10:38

Re: New Dynamic Script Ideas

You're right Lewin, maybe some new graphic will solve it, like colored circle like this ( o )
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 28 Apr 2014, 10:14

Re: New Dynamic Script Ideas

Over the past week (since r6157) I've added the following:
6216 OnMarketTrade
6216 Actions.MarketTradeSet
6216 States.MarketValue
6217 States.MarketLossFactor
6216 States.ClosestHouseMultipleTypes
6216 States.ClosestUnitMultipleTypes
6216 States.ClosestGroupMultipleTypes
6220 Allow high volume boost for positional script sounds since they are much quieter than non-positional sounds
6220 Actions.PlayWAVFadeMusic
6220 States.HouseUnlocked
6220 OnGroupHungry
6222 Actions.PlayWAVLooped
6222 Actions.PlayWAVAtLocationLooped
6222 Actions.StopLoopedWAV

The commands ClosestHouse/Unit/Group were all updated to let you specify the type, but if you want to search for multiple types at once (e.g. closest inn, school or storehouse) you can use Closest*MultipleTypes.

These are all documented at the usual place:
http://code.google.com/p/castlesand/wik ... ptsDynamic

If you have any comments about these new commands please let me know, do they do what you want?

Things I'd like to add before the next release:
States: HouseMarketFromWare, HouseMarketToWare, HouseMarketAmountOrdered (query what the player has ordered at a market)
Actions: AddRoad, AddWinefield, AddField (adds them instantly in finished state)
PingMinimap (alert the player to something)
Maybe some basic terrain editing ability (tile type/rotation, objects, height)

Is there anything that anyone would like to have implemented for the next release? If you need something implemented for your mission/idea, let me know here :)
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

KaM Skill Level: Beginner

Website: https://github.com/andreus791/maps_feedback

Location: Russia

Post 28 Apr 2014, 11:46

Re: New Dynamic Script Ideas

more options for AI: defend allies, auto attack range, start position
these would be cool, at least start position: you can set one attack in MapEd and then change attack target with Actions.AIStartPosition (it's easier than write custom code, and makes missions more interesting - you never know where the attack will be)

also Actions.RemoveField works strange, it deletes fields but saves their "background" - please check ;)
  Code:
procedure OnMissionStart; var X, Y: Integer; begin for X := 0 to 64 do for Y := 0 to 64 do Actions.RemoveField(X, Y); end;
Image

btw in wiki there is no description for OnMarketTrade event ;) Also, we can read this (for AIEquipRate and SetFormation):

1 - player index
2 - type
2 - rate

1 - player index
2 - Group type
2 - Units
3 - Columns
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 28 Apr 2014, 13:26

Re: New Dynamic Script Ideas

event OnPlanRemove and if the Actions.AddWaresToHouse will be working for building materials for example when the Laborer removes plan and spawn solid plan then i give 4 stone, 3 timber by script so the laborer can build it without any roads , serfs etc and Actions.HouseAddRepair will be great if work for buidling houses without laborer, example: solid plan (substructure) - and every 10 sec it builds 10 hp.
also Actions.AddSolidPlan(aPlayer, aType, X, Y) will be great.
With these scriptis ill be able to build houses over time.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 28 Apr 2014, 14:07

Re: New Dynamic Script Ideas

more options for AI: defend allies, auto attack range, start position
these would be cool, at least start position: you can set one attack in MapEd and then change attack target with Actions.AIStartPosition (it's easier than write custom code, and makes missions more interesting - you never know where the attack will be)
Ok, I'll add those.
also Actions.RemoveField works strange, it deletes fields but saves their "background" - please check ;)
That's because we can't know what was under the field. RemoveField shouldn't have been implemented really. What do you want it for?
btw in wiki there is no description for OnMarketTrade event ;) Also, we can read this (for AIEquipRate and SetFormation):

1 - player index
2 - type
2 - rate

1 - player index
2 - Group type
2 - Units
3 - Columns
Fixed, thanks.
event OnPlanRemove and if the Actions.AddWaresToHouse will be working for building materials for example when the Laborer removes plan and spawn solid plan then i give 4 stone, 3 timber by script so the laborer can build it without any roads , serfs etc and Actions.HouseAddRepair will be great if work for buidling houses without laborer, example: solid plan (substructure) - and every 10 sec it builds 10 hp.
also Actions.AddSolidPlan(aPlayer, aType, X, Y) will be great.
With these scriptis ill be able to build houses over time.
Hmmm ok those sound useful :)
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

KaM Skill Level: Beginner

Website: https://github.com/andreus791/maps_feedback

Location: Russia

Post 28 Apr 2014, 14:31

Re: New Dynamic Script Ideas

also Actions.RemoveField works strange, it deletes fields but saves their "background" - please check ;)
That's because we can't know what was under the field. RemoveField shouldn't have been implemented really. What do you want it for?
I thought, this is one of ways to create script for a map where some players can be human or AI: build towns in MapEd, and then check player type in script
  Code:
if States.PlayerIsAI(playerID) then begin add wares give serfs ... ... end else begin destroy unneeded houses remove fields remove roads ... ... end; end;
now (if you implement AddRoad/Field) it can be replaced with Actions.AddRoad/Field: give a storehouse in MapEd, and then give extra houses/roads/fields/wares etc through dynamic script.
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

KaM Skill Level: Beginner

Website: https://github.com/andreus791/maps_feedback

Location: Russia

Post 29 Apr 2014, 19:51

Re: New Dynamic Script Ideas

One guy (on kamclub.ru) asks about OnConsoleInput. Is it possible to implement it before next Remake release? ;)
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 30 Apr 2014, 04:05

Re: New Dynamic Script Ideas

AlexandrV I presume? We don't even have a console, yet input in it. I think we have rejected most of his ideas for good. However console could be nice for some things, but this is not high on our priority list.
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
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 01 May 2014, 01:57

Re: New Dynamic Script Ideas

Giving the script a better way for input would be neat. The most advanced solution would be letting the script create a popup panel (button next to chat/allies/message log) and place controls on it like buttons, dropdowns, checkboxes, etc. then get events when the dropdowns change or the buttons are clicked. This would take a fair bit of work (lots of new commands) but would give a lot of control to script authors since players could interact with the game in very sophisticated ways.

Console sounds like a cheaper version of that. Asking players to memorize and type command names into a console isn't a very neat solution really, it's just easier to implement.
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 02 May 2014, 16:30

Re: New Dynamic Script Ideas

Giving the script a better way for input would be neat. The most advanced solution would be letting the script create a popup panel (button next to chat/allies/message log) and place controls on it like buttons, dropdowns, checkboxes, etc. then get events when the dropdowns change or the buttons are clicked. This would take a fair bit of work (lots of new commands) but would give a lot of control to script authors since players could interact with the game in very sophisticated ways.
That will be awesome :D
Actions.BlockGroupControl(aGroup: integer); - block control for player owner, orders only with script, but player still owns group ( so the OnUnitDied - aKillerIndex will work with it) - i have idea for map where you control only one group/buildings that sending army waves( 4 v 4), win based on specific counter/eco not micro skills.
Im thinking about Actions.UnitKill(true) - can we change it? if true it removes unit completely so i can build house right after that. like this:
  Code:
UnitKill(u, true); GiveHouse(h, t, x(u), y(u));
i used OnUnitAfterDied but it worked kinda wierd. so i just made 'counter' if c=1 then killUnit; if c=0 then givehouse;
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 03 May 2014, 04:47

Re: New Dynamic Script Ideas

Yes, BlockGroupControl sounds good :) I've added it to the todo list for the next release. Is your idea like DOTA or LOL? ;)

UnitKill has to be delayed because of the way the game works. There is no way to instantly remove a unit, in some situations the unit needs 1-2 ticks to finish what they are doing (mainly interaction with others units). If we removed them instantly it would crash the game in some situations. I know that OnUnitAfterDied is kind of annoying to work with, but unfortunately it's necessary. Your counter might not work in all situations, I think it can sometimes take 2 ticks for a unit to be removed (although usually it should only be 1).
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 03 May 2014, 09:10

Re: New Dynamic Script Ideas

Yes, BlockGroupControl sounds good :) I've added it to the todo list for the next release. Is your idea like DOTA or LOL? ;)
DOTA games need some hero stats :P but its funny i have similar map :D hero+spells+sending waves xD, yea but with blockgroup i willl be able to make some "spawn spells" etc :D
I was thinking about something like that too:
https://www.youtube.com/watch?v=_BjRh7VhBjQ
UnitKill has to be delayed because of the way the game works. There is no way to instantly remove a unit, in some situations the unit needs 1-2 ticks to finish what they are doing (mainly interaction with others units). If we removed them instantly it would crash the game in some situations. I know that OnUnitAfterDied is kind of annoying to work with, but unfortunately it's necessary. Your counter might not work in all situations, I think it can sometimes take 2 ticks for a unit to be removed (although usually it should only be 1).
Ok :> im using counter 10 ticks (per 1 sec) :> thanks for information i will rember 1-2 ticks, i was convinced that it alwyas takes 1 tick :P

Return to “Ideas / Suggestions”

Who is online

Users browsing this forum: No registered users and 9 guests