notifications!

Everything about mods can be found here.

Moderator: Morax

notifications!

Postby Myxir » 14 Feb 2015, 19:10

Notifications!
Extensible Notification Mod
Image

latest version: v5.2
this mod requires common mod tools v1 to work

Image


1. Features

- 16 default notifications, in 4 categories:
    timed: (will pop up at a certain game time)
    - antinuke
    - scout
    conditional timed: (will pop up at a certain game time, but only if the requirement is not fulfilled)
    - build energy storage, until max energy storage is >5000
    - airstaging, unless already built
    observer: (observing default game vars/input for stuff you'd like to know)
    - unit command executed
    scripts (event checks)
    - acu losing hp: when the ACU loses an average of 1% or more hp/shield per second (still 100 hp/s for cybran ACU), or 3% in one strike
    - acu low hp: when the ACU is below 25% hp
    - energy overflow: at least 10% more income than used for 10 seconds straight
    - stored mass: having more than 50% or 5000 mass in storage
    - lost smd/omni: losing either of these
    - mex upgrade finished
    - hq upgrade finished
    - tactical missles ready
    - nuke missiles ready
    - factories idle
    - engineers idle
- extensible: easy to add new notifications
- notifications will use the icons of the (e.g. idle) units which they refer to, considering faction and tech
- can easily disable (via ingame UI) or remove (delete from mod folder) notifications
- configurable: clicking a notification in the ingame preferences menu allows further configuration of it
- UI can be moved, minimized, and further configured via the ingame UI preferences
- notifications can ping related units
- ingame preferences for various options
Image
- leftclick (select units), rightclick (select + zoom to units)
- hotkeys: left/rightclick last, or left/rightclick cycle clickable notifications
Image
- cycling: starting from last, clicks the previous one, starts from first when all were cycled through
Image


2. Installing

Download from the FAF vault!
Search for Notifications and press the Server Search Button to get the latest version


3. Adding/Removing notification files or images

you can write your own notifications, or just add already existing ones.
to add, check where your mod is located, probably in C:\Users\%USERNAME%\Documents\My Games\Gas Powered Games\Supreme Commander Forged Alliance\Mods\reminder\notifications.
drop the files in the correct folders, their naming should make it pretty obvious.

you can also easily replace icons (not the official ones though), which are in C:\Users\%USERNAME%\Documents\My Games\Gas Powered Games\Supreme Commander Forged Alliance\Mods\reminder\resources


4. Ideas for future versions

- add sounds to notifications (possibly some that are not in the game yet)
- "acu under attack": find a way to not show shield hp while it's recharging but not active
- notification for some events like nuke launch
- get pings to display when the player is zoomed in
Last edited by Myxir on 05 Jan 2016, 17:30, edited 23 times in total.
Unhappy with balance http://i.imgur.com/q5G2BlM.png
User avatar
Myxir
Evaluator
 
Posts: 791
Joined: 09 Apr 2012, 14:01
Has liked: 94 times
Been liked: 306 times
FAF User Name: Washy (irc)

Re: notifications!

Postby ZeRen » 14 Feb 2015, 20:12

really cool

idea: you click on notification and it move your camera on part of map where the notification is happening
"experimental spoted!"
"MEX finished upgrade"
"nuke is ready"
User avatar
ZeRen
Evaluator
 
Posts: 641
Joined: 03 Aug 2014, 08:22
Has liked: 154 times
Been liked: 49 times
FAF User Name: ZeRen

Re: notifications!

Postby StefanD » 14 Feb 2015, 20:57

This needs to me expanded, you can make it send a notification after a certain unit is built, like an HQ or a Experimental.
StefanD
Crusader
 
Posts: 16
Joined: 29 Dec 2014, 19:40
Has liked: 4 times
Been liked: 1 time
FAF User Name: StefanD

Re: notifications!

Postby speed2 » 14 Feb 2015, 21:18

I like it as far as it stay to only notifications, I dont think it would be good if it scouted for you by telling you what enemy has, this is thing you should do yourself. Reminding to scout is fine.
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: notifications!

Postby Aulex » 14 Feb 2015, 21:19

"Scouting saves lives"
Lol, I approve
"Let's start beating ass and die" - drunk TA4Life

"Just because you have a d*** doesn't mean you need to be one...pussy" -Blackdeath

SCOUTING SAVES LIVES
http://imgur.com/YGk0W0o

How to play Sup Com by Ubilaz
http://goo.gl/je83z
User avatar
Aulex
Contributor
 
Posts: 1050
Joined: 17 Nov 2012, 05:29
Has liked: 299 times
Been liked: 225 times
FAF User Name: VoR_Aulex

Re: notifications!

Postby Myxir » 15 Feb 2015, 15:58

did some changes to the architecture, less possibilities to configure but the scripts can influence the notification text/subtext/icon now

also:
Image

still needs a bit love though.


when i'm done with the framework stuff, i'm going to add some of the requested notification scripts and upload it to the vault
Unhappy with balance http://i.imgur.com/q5G2BlM.png
User avatar
Myxir
Evaluator
 
Posts: 791
Joined: 09 Apr 2012, 14:01
Has liked: 94 times
Been liked: 306 times
FAF User Name: Washy (irc)

Re: notifications!

Postby Myxir » 15 Feb 2015, 20:52

before i upload this to the vault:
- higher resolution pictures of mass/energy icons needed, the current ones are scaled up and thus ugly *hint*


architecture changes:
- icon folder is now reminder\notificationIcons
- script folder is now reminder\notificationScrips
- config.lua is reduced, scriptfiles are just referenced by names
- scripts can now set text, subtext and icon of the message dynamically


added:
- two scripts: HQ upgrade finished check, nuke missile built check
- ingame configs to enable/disable a script (check the post above)


if you're impatient, the current version (1.1) is attached


Image

Image
Attachments
reminder.zip
(123.03 KiB) Downloaded 205 times
Unhappy with balance http://i.imgur.com/q5G2BlM.png
User avatar
Myxir
Evaluator
 
Posts: 791
Joined: 09 Apr 2012, 14:01
Has liked: 94 times
Been liked: 306 times
FAF User Name: Washy (irc)

Re: notifications!

Postby Ceneraii » 15 Feb 2015, 20:58

I like it, maybe I can finally take the post-its off my screen soon :D
Ceneraii
Avatar-of-War
 
Posts: 268
Joined: 16 Nov 2013, 21:45
Has liked: 104 times
Been liked: 81 times
FAF User Name: Ceneraii

Re: notifications!

Postby ZeRen » 15 Feb 2015, 21:51

is there possibility for sound alert?
User avatar
ZeRen
Evaluator
 
Posts: 641
Joined: 03 Aug 2014, 08:22
Has liked: 154 times
Been liked: 49 times
FAF User Name: ZeRen

Re: notifications!

Postby Senteth_Loken » 15 Feb 2015, 21:55

Thanks for this, was going to build something similar myself for mass extractors (though using the notify enhanced stuff with a message to self, this is much better...

I have already made a script for the mass extractor upgrade and i also saw the opportunity to have Mass extractor lost! which i think will also be useful when you get tml'ed

EDIT:

Bug: HQ upgrade shows as "Finished" when you begin the upgrade this is because the unit is created at the beginning of the upgrade not the end,
Im working on this as it affects the Mass Extractors too. I ill let you know if i find a solution.

EDIT 2 :
Ok I made a Fix for the Mass Extractors, you should be ale to use something similar for the Factory's script,

I made a total count and excluded ones that where not idle

if both the tech level count and the Idle-Total count drop then one has been lost.

if the Idle-Total stays the same but one of the Tech count drops then an upgrade has been finished.

issue with this is if the upgrade has been cancelled then it shows as completed but since you don't unknowingly cancel an upgrade i don't see this being a big issue.

the idle side of things may not work for the factories as they are not always idle while not upgrading but maybe its worth a try

Here is the code anyway, I Hope it helps.

Code: Select all
local modpath = "/mods/reminder"
local config = import(modpath..'/config.lua').getConfig()
local selectHelper = import(modpath..'/modules/selectHelper.lua')

local fixedConfig = {
   id = "massFinished",
   retriggerDelay = 0,
   additionalDuration = 0,
}
local runtimeConfig = {
   text = "Mass Extractor Finished",
   subtext = "Mass Extractor Upgrade finished",
   icon = 'gearwheels.png',
}
function getFixedConfig()
   return fixedConfig
end
function getRuntimeconfig()
   return runtimeConfig
end


local ExPrev = {
   T1 = {
      Mass = 0,
   },
   T2 = {
      Mass = 0,
   },
   T3 = {
      Mass = 0,
   },
   Total = {
         Mass = 0,
      },
}


function init()
end


function triggerNotification()
   local Ex = {
      T1 = {
         Mass = 0,
      },
      T2 = {
         Mass = 0,
      },
      T3 = {
         Mass = 0,
      },
      Total = {
         Mass = 0,
      },
   }

   for _,u in selectHelper.getAllUnits() do
      if(u:IsInCategory("MASSEXTRACTION") )then
            uTech = "T1"
            uKind = "Mass"

            if(u:IsInCategory("TECH2") )then
               uTech = "T2"
            end
            if(u:IsInCategory("TECH3") )then
               uTech = "T3"
            end
            local isiddle =  u:IsIdle()
            Ex[uTech][uKind] = Ex[uTech][uKind]+1
            if(isiddle)then
               Ex["Total"][uKind] = Ex["Total"][uKind]+1
            end
            
      end
   end
   runtimeConfig.subtext = ''
   notificationIsReady = false
   for iTech,vTech in Ex do



      for iKind,vKind in vTech do
         if(iTech ~= 'Total')then
            if(Ex[iTech][iKind] < ExPrev[iTech][iKind]) then
               runtimeConfig.subtext = iTech..' '
            end
         end

      end      
   end
   if(runtimeConfig.subtext ~= '')then
      if(Ex["Total"]["Mass"] ==  ExPrev["Total"]["Mass"]) then
         runtimeConfig.subtext = runtimeConfig.subtext..'Extractor finished Upgrading'
         notificationIsReady = true
      elseif(Ex["Total"]["Mass"] <  ExPrev["Total"]["Mass"]) then
         runtimeConfig.text = 'Mass Extractor Lost!!'
         runtimeConfig.subtext = runtimeConfig.subtext..'Extractor Lost!!'
         notificationIsReady = true
      end
   end


   for iTech,vTech in Ex do



      for iKind,vKind in vTech do

         ExPrev[iTech][iKind] = Ex[iTech][iKind]
         

      end      
   end

   if(notificationIsReady) then
   return true
   end
   return false

end




function cutBpId(s)
   return string.sub(s, 4, 6)   
end
Senteth_Loken
 
Posts: 2
Joined: 15 Feb 2015, 21:51
Has liked: 0 time
Been liked: 1 time
FAF User Name: Senteth_Loken

Next

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest