Page 20 of 24

Re: New Dynamic Script Ideas

PostPosted: 06 Oct 2014, 16:51
by Ben
Not sure if recommended yet, but "Actions.PlayerColorChange" would be nice.
Haha, amazing trolling tactic detected xD

Re: New Dynamic Script Ideas

PostPosted: 06 Oct 2014, 16:59
by Strangelove
Not sure if recommended yet, but "Actions.PlayerColorChange" would be nice.
Haha, amazing trolling tactic detected xD
Well, i guess it could easily be abused to troll others, but I had something different in mind lol. I would need it to separate AIs easier from each others if i really them (part of a map in my campaign). I wasn't planing for anything shady lol.

Re: New Dynamic Script Ideas

PostPosted: 06 Oct 2014, 22:41
by Ben
Meh, I like my idea better (6)

Re: New Dynamic Script Ideas

PostPosted: 13 Oct 2014, 18:09
by Ben
Can we have a script to detect the host? Could be very useful for some special gamemodes where someone needs to select settings ingame :)

Re: New Dynamic Script Ideas

PostPosted: 18 Oct 2014, 14:54
by Esthlos
I find it strange that nobody asked this yet (but I can't remember where did you post the link with the proposed features, so I can't actually check this :$ ), but can we please have an Actions.HouseLock command, to do the opposite of Actions.HouseUnlock?

Re: New Dynamic Script Ideas

PostPosted: 18 Oct 2014, 18:53
by RandomLyrics
I find it strange that nobody asked this yet (but I can't remember where did you post the link with the proposed features, so I can't actually check this :$ ), but can we please have an Actions.HouseLock command, to do the opposite of Actions.HouseUnlock?
HouseAllow(false) it will do the job :P

Re: New Dynamic Script Ideas

PostPosted: 18 Oct 2014, 19:08
by Esthlos
I find it strange that nobody asked this yet (but I can't remember where did you post the link with the proposed features, so I can't actually check this :$ ), but can we please have an Actions.HouseLock command, to do the opposite of Actions.HouseUnlock?
HouseAllow(false) it will do the job :P
Thank you.

I knew this (used it in Golden Cliffs - Bonus), but it disables wares' distribution for that building too, and if the unlock was supposed to be temporary then there needs to be dedicated scripting to re-enable it when the time comes in the construction tree... a HouseLock command would have none of these cons, and would in my opinion be a more elegant way of reverting HouseUnlock.

Re: New Dynamic Script Ideas

PostPosted: 08 Dec 2014, 16:48
by Esthlos
I don't know if these would be hard to implement, bet here are a few commands I'd gladly use if I could:
  • States.UnitSelected(player) and/or procedure OnUnitSelected(player, UnitID): know which unit is currently selected (or has been selected last; by using a global variable to store the value, the two things become the same)
  • States.HouseSelected(player) and/or procedure OnHouseSelected(player, HouseID): know which building is currently selected
  • Actions.ForceSelect(player, ID): force a player to select a building or unit
  • Actions.GiveUnitFromHouse/GiveGroupFromHouse: same as GiveUnit/GiveGroup, but the new unit/group comes out of a building instead of spawning on the ground
  • Actions.UnitSetCarrying(unitID, ware type) or Actions.UnitSetCarryingAndOrderWalk: give a ware to a serf; if his AI tries to find immediately a building to bring it to, then Actions.UnitSetCarryingAndOrderWalk would let the scripter decide what the serf should do with that ware before the game logic decides otherwise
  • Actions.UnitKillInHouse(unitID/GroupID, houseID): the unit (or group) is ordered to enter the building (if he's not in there already), and is then removed (without playing the "exit from building" animation first, of course, or even cancelling it if it's already playing, if possible); this, by the way, would give a way to remove Recruits from inside their Barracks without playing their "exit from building" animation first
Now, what could these commands be used for?

Well, let me explain with a few examples: I tried to make a script that would allow Allies to trade with each other using the Marketplace.
But then found out that even though I could order around a non idle civilian (by killing him, then respawning him OnUnitAfterDied and immediately using Actions.UnitOrderWalk), I couldn't get him to enter a building, nor could I give him a ware to move.

Another example: in GoldenCliffs - Bonus, one of the bonuses allows the player to recruit Barbarians... but its implementation is ugly.
With a UnitKillInHouse function, I could kill the Militia before he leaves the Barracks, and then spawn a Barbarian with GiveGroupFromHouse... way way better.

One last example: with these functions, it would be possible to fake a TPR recruiting centre in any building.
How? Simple:
  • Give the player a Barracks hidden in an unexplored area (the fog doesn't update, if the area is covered after the building is completed), and make sure it always has Leather Armors and Shields
  • When the player produces a Wooden weapon, find a serf who is idle (if there aren't, just kill a serf who is not carrying anythin and respawn him OnUnitAfterDied) and order him to enter the workshop with Actions.UnitKillInHouse
  • when he's inside and died (OnUnitAfterDied will run with his Unit Type and with the building's X and Y coordinates), respawn him inside the same building, give him the produced weapon and order him to enter your "fake recruiting centre", and remove one weapon from the workshop
  • when he's inside it and died, respawn him one last time and add the weapon to the hidden Barracks
  • When the player selects the fake recruiting centre, have him select the hidden Barracks instead
  • if he trains a Scout, kill him and have a Vagabond exit the fake recruiting centre; if he trains a Bowman, have a Rogue exit instead; and so on
I know, this last one looks complex, but keep in mind this is just an example of the possibilities... also, imagine how neat would something like this be in a campaign mission!

What do you think about this?

Re: New Dynamic Script Ideas

PostPosted: 23 Dec 2014, 23:41
by Michalpl
A script bool for allowing every tree to get cut?
And maybe a bool for making exhausted mountains mineable as stone?

Re: New Dynamic Script Ideas

PostPosted: 24 Dec 2014, 07:13
by Krom
@Michalp: These are not script ideas. These are gameplay mechanics changes, that 'could be' made scriptable after their implementation. Both answers are no, these are established elements of the game.

Re: New Dynamic Script Ideas

PostPosted: 11 Jan 2015, 13:19
by thunder
Hi!
just a short question.
possible to give images, pictures as buttons to the game for the taskbar with dynamic scripts?
For example when open the school, then there will be plus 1-2 pictures as buttons when click on it , then will happen something by dynamic scripts.

Re: New Dynamic Script Ideas

PostPosted: 11 Jan 2015, 13:49
by Krom
Not possible at the moment, it would be a lot of work to add that feature and allow it to be used efficiently.

Re: New Dynamic Script Ideas

PostPosted: 11 Jan 2015, 14:07
by thunder
Thanks!

Re: New Dynamic Script Ideas

PostPosted: 14 Feb 2015, 21:33
by Michalpl
Actions.RegenerateAI_NavMesh it would update the mesh for AI when some tiles were changed(So AI could attack and defend when the tiles that were blocking path were gone).

Re: New Dynamic Script Ideas

PostPosted: 01 Mar 2015, 09:44
by Esthlos
Actions.UnitSetHero(UnitID, SetUnsetBoolean)
and
States.UnitIsHero(UnitID)

In the AED campaign and in special maps it would be useful to have a way to mark a particular unit as important or special.

It could be implemented as a Boolean property in KM_Units that just changes how the unit is painted in the game world (we could discuss the specific graphic change if this addition is agreed on).

What do you think about this?