Opened 9 years ago

Last modified 5 years ago

#2950 new enhancement

[PATCH] Extend / Improve Trigger functionality

Reported by: Niek Owned by:
Priority: Must Have Milestone: Backlog
Component: Simulation Keywords: patch triggers
Cc: tjh.hts@… Patch:

Description (last modified by Niek)

With my recent work on Triggerscripting, it appears to me that the Trigger workflow (includes Triggerhelper.js) could use some additional functionality to ease scripting.

This includes (but is not limited to): Pre-written functions for:

  • Adding resources to players.
  • Pushing GUI notifications.
  • Supporting cinematics.
  • Enable/disable training of certain templates.
  • Changing unit stats.

Enhancing:

  • GUI dialog to allow for distinguishing multiple windows (possibly by allowing to set a button id to which can by checked against in the trigger code).
  • allowing for AI's and Triggerscripts to communicate with each other (not necessarily the AI code itself, but the ability to do so)

This list is not quite complete and more additions to the list would be appreciated.

Attachments (1)

GuiNotification.patch (818 bytes ) - added by Niek 9 years ago.
A patch for the GUI notification

Download all attachments as: .zip

Change History (14)

comment:1 by Niek, 9 years ago

Description: modified (diff)

comment:2 by Niek, 9 years ago

Description: modified (diff)

by Niek, 9 years ago

Attachment: GuiNotification.patch added

A patch for the GUI notification

comment:3 by Niek, 9 years ago

Keywords: patch review added
Summary: Extend / Improve Trigger functionality[Patch] Extend / Improve Trigger functionality

comment:4 by sanderd17, 9 years ago

It doesn't allow completely versatile messages with internationalisation support, like those used here: http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Player.js#L214

And when it would, I think the function would become too complicated.

So I think either the notification object should be passed directly, or the function should indeed be dumbed down to a certain level, but then it's debatable to what level.

comment:5 by Timothy Hamlett, 9 years ago

Cc: tjh.hts@… added

comment:6 by Itms, 9 years ago

Milestone: Alpha 18Alpha 19

comment:7 by NiAypa, 9 years ago

Adding resources is already possible with:

var cmpPlayer = TriggerHelper.GetPlayerComponent(playerID);
cmpPlayer.AddResources({
	wood: 100,
	stone: 100,
	metal: 100,
	food: 100
});

And same is

cmpPlayer.SetDisabledTemplates({template1: true, template2: true}); 

for disabling templates

Last edited 9 years ago by NiAypa (previous) (diff)

in reply to:  7 comment:8 by leper, 9 years ago

Replying to NiAypa:

cmpPlayer.SetDisabledTemplates({template1: true, template2: true}); 

Note that this changed in r16444 and you should now use

cmpPlayer.SetDisabledTemplates(["template1", "template2"]);

comment:9 by leper, 9 years ago

Keywords: review removed

As already noted by sanderd17 the message change isn't really working.

comment:10 by mimo, 9 years ago

Milestone: Alpha 19Alpha 20

comment:11 by elexis, 8 years ago

Milestone: Alpha 20Backlog

Backlogging due to lack of progress.

comment:12 by Palaxin, 8 years ago

Summary: [Patch] Extend / Improve Trigger functionality[PATCH] Extend / Improve Trigger functionality

comment:13 by Imarok, 5 years ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

Note: See TracTickets for help on using tickets.