Mission Map - Custom Scenes, AI use of Cloak Hyperspace Gates random attack paths, and some fun Objectives

When I get home I will experiment and post code and results. Thanks

Unfortunately right now (at work) I am busy coding source repository code for my mainframe developers. bah… rather be working on homeworld! lol

1 Like

Real life getting in the way is always the worst :grin:

Okay,

MainUI_UserEvent( eResearchManager)

worked. Meaning it brought up research.

But these did not work. Nothing happened at all.

MainUI_UserEvent(eTacticalOverlay)
{“MainUI_UserEvent(eTacticalOverlay)”,""}, – Event table

EDIT*********
Okay I got it to work. Right when the mission starts both the OnInit() and Rule_Init() locations work. However once my* mission in on the way then it no longer works.

*(and stressing MY mission because I may be doing something to interfere with it as my HW2_Fade stops working deep into the mission as well) Possibly since this mission has a ton of code I am overloading something or just have too many processes running.

THANKS for you HELP.

I’ve made some very basic tests on my side as well.

MainUI_UserEvent(eTacticalOverlay) (or its event table variant) is the correct way to write it.

I had some doubts before, so I tried MainUI_UserEventData(eTacticalOverlay, x) (x being 0 to 3), but there is no difference in the behavior, it still cycle through each mode.
I had hope we would be able to call a specific tactical mode by adding the x parameter, but nope ^^

Thanks for your help. Just curious, the fact that it does not work for me deeper in my LUA, event table AND that I also lost the ability to do HW2_Fade what would be the most likely reasons? Could having too many RULE_Intervals affect this?

Or is there some LUA way to debug what a function does not work?

I don’t know, it’s really strange that it doesn’t work anymore during the mission :confused:

What you could try, just to test, is opening the newtaskbar.lua file (in /ui/newui), and replace
onMouseClicked = "MainUI_UserEvent( eResearchManager)",
by
onMouseClicked = "MainUI_UserEvent(eTacticalOverlay)",

It should cycle through the tactical overlay modes when you click on the Research button at the top right (that’s how I made my tests). If it doesn’t, there is definitely something strange interferring with it !

I have seen more and more strange things as I get deeper into the level. My LUA file has far more functions, objectives, variables, SOBGroups, and on and on than any other campaign map that was created in the original game. I keep wondering if I am stressing the system too much.

Of course I also have a TON of log writing going on which I would assume slows things down some.

I will have to experiment on that some. For now I got it working thanks to you.

You’re welcome :slight_smile:

Log writing is extremely expensive in terms of performance. I would strongly suggest turning most of it off for the release version.

Yup that is the plan, I have it all labeled with “DEV” for easy to remove. I have so many functions I decided to write the start and strop of each fucntion so I could make sure everything has a clear exit.

I have have lots of on going functions for AI brain that I was testing.

I have gotten my AI to:
*Randomly evade via hyperspace, random move locations, and cloak(and allowing cloak to recharge enough to use again).
*Send patrols to random locations based in on some “secret” criteria.
*Repair and regroup (though turning this off for the mission)
*Send hyperspace gates through the map and use them for flank attacks.
*Mine locations all over the map.

So yeah… all the ongoing processes and each one with its own PRINT TO LOG for start, stop, etc is crazy!

-B8factor

2 Likes

What you could do, is to put all your debug messages under a condition, like if debug==1 then print("xxxx") endif, and set the debug var in the beginning of the file.
It would be easier for you to go from debug mode to “normal” mode, to test if this heavy logging is sometime part of your problems or not (and also easier to deactivate for release).
That’s what I had done in one of my previous mod.

2 Likes

I thought about that, but with search/replace it is just as easy for me to say
Search

print(* --WFB DEV

and REPLACE

–print(* --WFB DEV

for every file in my MOD.

And I only have a single line of code for each instance of a print. Search And replace is something I use a lot in my UE and Eclipse so I am use to writing code with it in mind ahead of time. I have done that so much that I have my own “standard” syntax to make my life easier down the way.

But your method works well to.

Thanks

1 Like

I think i have a solution for this for scene later in the map. I am going to try it tonight.

I will make a new function and attack to the TAB key. Since I will know at what level of the tactical overlay the player starts with when the map starts (At least the first time the game is loaded).

Then any time the player hits TAB 2 things will happen. 1) it will change the tactics for them. 2) my function will run also to keep tack of where they are… I think.

image

Then when I need to turn off again… I know how many times to run:
image

EDIT-------
DING DING DING, it worked. I Can now tell… at any given moment, what tactical overlay the player is on and adjust for the next in game scene!

1 Like

Is UI_BindKeyEvent still working ? I seem to remember a previous discussion with @BitVenom about being careful with it, because it could become unsupported in the future…

After some research, here it was : [SOLVED][UI] newtaskbar.lua buttons

It is, right now it is being used in the campaign in multi locations. I use it for development all the time as I can toggle developer functions on the fly inside playing the game.

1 Like

Okay fellow MODers, if you got 45 minutes to spare… ha ha Hardy har har… what moder has 45 spare MINUTES! Anyway, I am just days away from releasing this map. I need some feedback on a play through while the wife and I wrap up the last audio dubs.

The mission IS HARD! I know the general rule of thumb is that if the developer thinks it is hard it is TOO HARD. But I believe Homeworld has been around long enough to have developed some very good players.

Give it a go! Give me some feedback. Let me get this MOD out the door so I can regain my weekends back… right wife! @Gameg1rl hehe

I still need a tad of tweaking on the stats but here is my last play through.
image

2 Likes

Question for LUA ppl out there… this is my first lua project. How do I show time in 9.99 format?

here is my code:

g_totaltime = format("%u", Stats_TotalDuration() / 60)

I think this is what you’re looking for re: formatting.

http://www.computercraft.info/forums2/index.php?/topic/2679-luaquestion-limiting-decimal-places-of-a-variable-after-a-calculation/

Edit: to speak to the map, I like it! Great camera work, though the opening cinematic seems to run too long and have too many redundancies or people inquiring about things they should already know. That will probably end up being very subjective though.

Gameplay is fun, and it has that same “throwing everything at you constantly” feeling that stock missions like Sarum Shipyards has - good job there. I did notice a possible glitch or cheese though - after the opening cinematic, it seems like allied ships don’t take any damage until you contact and activate them? I watched a Hiig BC soak up Vay BC trinity cannons with no effect.

Edit 2: Oh and I did get my butt kicked, but only of my own accord - some HMF’s snuck up behind my carrier and blew it to bits when my fleet went off to rescue Sakala.

1 Like

g_totaltime = gsub(format("%.2f", Stats_TotalDuration() / 60), “%.00”, “”)

should do the trick.

format("%.2f", Stats_TotalDuration() / 60) should work alone, but sometimes it will give something like 2.270000000001 and screw the display (it’s due to floating point approximation)
That’s why I use gsub(x, "%.00", "") to force the elimination of any unwanted additionnal characters.

1 Like

perfect! thanks.

1 Like