Map Database  •  FAQ  •  RSS  •  Register  •  Login

New Dynamic Script Ideas

<<

Ben

User avatar

Council Member

Posts: 3806

Joined: 08 Jan 2009, 23:00

Location: California GMT - 8 (Standard Time)

KaM Skill Level: Beginner

Post 13 Apr 2013, 04:44

New Dynamic Script Ideas

The name of the topic should make it obvious, but here is where we can give ideas for new Dynamic script codes.

For my first idea, I would like to be able to play a .mp3, .wav, or other sound files using Dynamic Script. If done correctly, this can add a lot of depth to a mission, such as brief dialog, or music for cut scenes.

What do you think? Is it a good idea?
#thunderposting #greentornado
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 13 Apr 2013, 05:18

Re: New Dynamic Script Ideas

Good idea making this topic :) I've made it sticky so it will stay up at the top.

We were slightly hesitant about letting you play sounds because that could be annoying/disruptive to the user if used incorrectly. Also there's currently no way to do a "cutscene" because you can't stop the user moving his view around (which is something we might add eventually).

I guess there's no big problem with playing sounds or doing cutscenes, it's up to the map author to use it correctly and obviously we won't accept scripted maps into the Remake if they play annoying sounds all the time or are poor quality.

Before someone asks, we plan to eventually have a command to change the owner of houses/units/other assets (so you could capture an enemy village and gain control over it). However this is complicated to implement, what if you are given control of an inn which has an enemy unit eating in it? That could cause all sorts of errors in the game. We probably won't have it implemented for this release, hopefully the next one.
<<

Ben

User avatar

Council Member

Posts: 3806

Joined: 08 Jan 2009, 23:00

Location: California GMT - 8 (Standard Time)

KaM Skill Level: Beginner

Post 13 Apr 2013, 05:30

Re: New Dynamic Script Ideas

Thanks, Lewin. I'm honored to be the author of a sticky thread :D

I don't see it being a problem if authors spam noises and such. Nobody would play such an annoying mission anyway.
Plus, authors can still spam the same object on a map 1,000 times; which could be just as annoying. Everything must be in moderation! :wink:

I was just about to say that cutscenes could be possible (to an extent) if you changed his units to another player (of the same color) for the duration of the cutscene, but I see now that ownership changing isn't possible yet. I suppose that we could use slilent kill unit and replace it with someone elses, and then repeat the process again after the scene is done, but that would be a ton of work, tricky to do (unit positioning would need to be exact) and it would look very bad.
#thunderposting #greentornado
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 13 Apr 2013, 06:02

Re: New Dynamic Script Ideas

It would be possible for us to change which player the human is controlling, similar to when you press F11 and click the number radio boxes to select which player you control. That would be more tricky in multiplayer but should still be possible to implement (e.g. so allies could swap control to each other's stuff). We eventually plan to have spectators and allow users to control multiple "players" at the same time (maybe if your ally quits), but that's a fair bit of work and needs to be carefully designed. It certainly won't be implemented for this next release.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 13 Apr 2013, 07:44

Re: New Dynamic Script Ideas

Would it be possible to place game graphics at at a certain location? For example a flag? Or even an image from outside.

Also, a possibility to format text a little more would be nice. For example center it, or increase size.
<<

Ben

User avatar

Council Member

Posts: 3806

Joined: 08 Jan 2009, 23:00

Location: California GMT - 8 (Standard Time)

KaM Skill Level: Beginner

Post 13 Apr 2013, 07:45

Re: New Dynamic Script Ideas

Another one: ObjectInArea. Whether it is a unit or building, I'd like to be able to have a state that checks if something is in a certain spot.
#thunderposting #greentornado
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 13 Apr 2013, 09:01

Re: New Dynamic Script Ideas

Siegfried wrote:Would it be possible to place game graphics at at a certain location? For example a flag? Or even an image from outside.

Inserting graphics onto the map (or overlaid like the text overlay) is something we might add eventually, but probably not in this release. It would certainly allow some cool stuff :)

Siegfried wrote:Also, a possibility to format text a little more would be nice. For example center it, or increase size.

Changing font size is not possible with KaM's bitmap fonts, but we could allow changing alignment (center/left/right) and moving it to a different place on the screen. We could also allow you to choose which KaM font you use.

Ben wrote:Another one: ObjectInArea. Whether it is a unit or building, I'd like to be able to have a state that checks if something is in a certain spot.

Do you mean "is this unit within this area?" (you provide UnitID and area, true/false result) or "give me a unit within this area" (you provide area, it gives you unit ID). The first you can write yourself as a function, like this:
  Code:
function UnitInArea(aUnitID, Left, Top, Right, Bottom: Integer): Boolean;
begin
  Result := (States.UnitX(aUnitID) >= Left) and (States.UnitX(aUnitID) <= Right) and (States.UnitY(aUnitID) >= Top) and (States.UnitY(aUnitID) <= Bottom);
end;

Put that function at the top of your script, then you can do something like this:
"if UnitInArea(MyUnit, 10, 10, 20, 20) then"
where MyUnit is a variable storing a unit you created or found earlier (with Actions.GiveUnit or States.UnitAt or OnUnitTrained or something)

We're planning to add GetClosestUnit(Player, X, Y) (and same for house/group) eventually, which covers you other case.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 13 Apr 2013, 09:14

Re: New Dynamic Script Ideas

Lewin wrote:
Siegfried wrote:Also, a possibility to format text a little more would be nice. For example center it, or increase size.

Changing font size is not possible with KaM's bitmap fonts, but we could allow changing alignment (center/left/right) and moving it to a different place on the screen. We could also allow you to choose which KaM font you use.

You could double the size of that.
Would be perfect for King of the Hill-Maps. A double-size text in the middle counting "24 seconds to win".
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 13 Apr 2013, 09:23

Re: New Dynamic Script Ideas

Siegfried wrote:You could double the size of that.
Would be perfect for King of the Hill-Maps. A double-size text in the middle counting "24 seconds to win".

It looks pretty pixely when you do: (that's 2x scaled)
Image
If we smoothly scale it, it looks blurry.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 13 Apr 2013, 09:52

Re: New Dynamic Script Ideas

Well, there are certainly some scalers that work good on text.
You're using GPU power anyway, so this could be even realized in a shader program at practically no extra cost.

For text, maybe the hqnx would be nice. It's a simple algorithm with medium cost. And it's a free algorithm.
hq2x -> http://hiend3d.com/hq2x.html
hq3x -> http://hiend3d.com/hq3x.html

OK, tbh that's not the scaler that I use with my DosBox, I use SaI for the lower cost. So we're already at the scaler-wars now ;)
And yes, it gives this nasty comic-style-look. But it's meant for the fonts only (and maybe my needed flags? ;) ) To make it double and triple size.
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2152

Joined: 29 Aug 2007, 22:00

Location: In his dark thunderstormy castle

KaM Skill Level: Veteran

Post 13 Apr 2013, 20:26

Re: New Dynamic Script Ideas

I agree with Ben, playing sounds should definately be possible. In Tower Defence, I would like to play the 'peace time is over'-sound every time a new wave approaches. That would be much more convenient than sending messages to the players.
<<

Krom

User avatar

Knights Province Developer

Posts: 3237

Joined: 09 May 2006, 22:00

Location: Russia

KaM Skill Level: Fair

Post 14 Apr 2013, 05:47

Re: New Dynamic Script Ideas

Just on a sidenote, "playing sounds AND sending messages" is required. Many players (including me) play with sounds off for various reasons ;)
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
<<

Ben

User avatar

Council Member

Posts: 3806

Joined: 08 Jan 2009, 23:00

Location: California GMT - 8 (Standard Time)

KaM Skill Level: Beginner

Post 14 Apr 2013, 06:16

Re: New Dynamic Script Ideas

Sorry, Dark Lord, but Krom is right. Plus, it's a decent practice for accessibility reasons to always have multiple ways of getting information in case handicapped people are using the program, etc. For example, a deaf person could be playing Tower Defense.

This is also why it is important for games to have an option to display names or other captions over units to show which player they belong (in case a colorblind person is playing).
#thunderposting #greentornado
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2152

Joined: 29 Aug 2007, 22:00

Location: In his dark thunderstormy castle

KaM Skill Level: Veteran

Post 14 Apr 2013, 09:22

Re: New Dynamic Script Ideas

Hm, yeah. Point taken. (Although: how do you notice if there is a new message without sound?)

BUT!

Then I have a request: to be able to disable the usual message sound, so players who don't mute KaM sounds won't hear two sounds at the same time.
<<

Bence791

Knight

Posts: 618

Joined: 20 Jul 2012, 20:25

Location: Hungary

KaM Skill Level: Beginner

Post 14 Apr 2013, 13:18

Re: New Dynamic Script Ideas

An idea:

If there is "Actions.UnitKill", is it possible to make "Actions.GroupKill"? I mean not to kill only 1 soldier, but the whole group. I want to be able to do such evil things. Haha (6)
The Kamper is always taking my colour!

Next

Return to Ideas / Suggestions

Who is online

Users browsing this forum: Majestic-12 [Bot] and 6 guests