Jump to content


Gambit

Member Since 02 Nov 2011
Offline Last Active Yesterday, 09:23 AM

#1119723 Understanding SGroups

Posted by Gambit on 30 June 2022 - 06:09 PM

I am not 100% sure, but I think the SGroup must not be empty...

(Arbitrary conjecture) I think that the SGroup_IsSelected boolean function  is True, only if at least one squad of the SGroup is selected...




#1119661 Scar Group objects Question along with other Scar Questions

Posted by Gambit on 26 June 2022 - 05:41 AM

Hello again brother.

 

...for example Player_GetEntities returns an Egroup, and I wonder if I can randomly select individual entities in the Egroup.

To select an individual entity, you need to us the EGroup_GetSpawnedEntityAt function.

Here is an example:

EGroup_Clear(EGroup_CreateIfNotFound("eg_TheNameYouWannaCallIt"))
local total = EGroup_CountSpawned("eg_TheNameYouWannaCallIt") -- All the entities of the EGroup
local rnd =  World_GetRand(1,total) -- Indexing starts from 1.
local entityID = EGroup_GetSpawnedEntityAt("eg_TheNameYouWannaCallIt",rnd)

... Or something. :grad:
The entityID  is of course a random entity, chosen from the EG.

 

 

 

 

Aside from these group objects I've been trying to print the players name with Player_GetDisplayName. But it prints out "table: 312B0D10" does this mean the LocString object is a table? and if so how do I get the display name out of it?

Player_GetDisplayName, indeed returns an array with more info. What you seek is the first element of that array. In other words:

local player_name = Player_GetDisplayName(playerID)[1]

 

And lastly I've been trying to get an alert to show up with the following line:
UIWarning_Show("hello World")

but it seems it doesn't do anything, I feel I'm missing something but I don't know what.

Try:

Util_MissionTitle("hello World")

... But remember, if a different event is running, then you may miss this one...

There is an alternative for this. You can try calling a function from your current function:

function YOUR_FUNCTION()
...
    Rule_Add(Rule_Display_Your_Message)
...
end


function Rule_Display_Your_Message()
    if not Event_IsAnyRunning() then
        Util_MissionTitle("hello World")
        Rule_Remove(Rule_Display_Your_Message)
    end
end



#1119646 SCAR question

Posted by Gambit on 24 June 2022 - 10:04 AM

Do I put them in scar/winconditions?

Yeap!

Remember to always include two files (the scar and the description one). You will see how it is with all other win conditions.

 

Now, if you want something to ALWAYS run, and not appear in winconditions, you must import it in the scautil file.

Again, see what I have done with Unification.

 

A word of caution: Unification is VERY complex.

I had to include checks, and fixes, and code that restores and remedies Vanilla limitations...

So it is NOT the best place to see "the basics".

Start from the unmodded DoW (the DXP2.module), and if you want something more challenging, you can always look into Unification SCaR :grad:




#1117563 Happy Holidays Revora Teams !

Posted by Gambit on 01 January 2022 - 05:46 PM

Happy 2022 brother ombrephenix <:)

 

And... Excellent work man!!

Can;t wait to see your latest build in action and perfect the Praetorian race Unification Support.

Just one question. You said:

There is a second layer of "experimental gameplay" that I reserve to the "Revored" teams for the expertise and the Chalege "A.i".

I am not sure I understand this completely, but if you need AI assistance, I can definitely help :grad:




#1116130 An Introduction to modding Dawn of War for beginners

Posted by Gambit on 21 August 2021 - 05:49 PM

Well... Difficult...

I think the Dark Eldar trick for global abilities cannot be used.

I am not the proper guy to answer for sure thou (this is why I avoided answering, above).

 

BUT, I have created tons of alternatives for the races we want such tricks.

All of them, have a common factor: A dummy entity that is spawned at the beginning of the game, and holds those abilities. Not dissimilar to the Dark Eldar method (the HQ holds the abilities there).

SCaR can of course replicate that as well, but I have not coded something like that, thus far.

 

To go even further, the Tyranids mod already have that, and in a REALLY advanced menu.

And in the (unreleased) Alien Hunters, there is an Orbital Center, where things are even more complex! The code alone is a MONSTER, but I am glad I have finished it :thumbsupcool:

 

Bottomline: IT CAN be done, but it is tricky.




#1116108 An Introduction to modding Dawn of War for beginners

Posted by Gambit on 20 August 2021 - 06:24 PM

Well, in short, each visible part of the screen is defined as a "buttons" with its specific function and stats. Its dimensions and specifics defined in the gamescreen file

Then, all these are grouped, utilized and GUI-ed in the taskbar file.

This is where the the GUI coding ends,

 

THEN, these are enabled/disabled at will with the SCaR script (that checks which race in in play, and ONs/OFFs the appropriate buttons for that specific race).

:thumbsuphappy:




#1114048 Is it possible to switch between default wargear and upgraded one?

Posted by Gambit on 18 March 2021 - 08:55 PM

SCaR is very simple, and anyone with prior coding knowledge will have an easy time with it :thumbsuphappy:

Even easier than Python.

 

BUT... Like all things, one needs time to adjust. Both to the new functions, and the environment.

Now, regrading Heroes, the solution's conception is "easy", the implementation.... Not that much.

 

The idea is:

1] For units that can posses, to additionally store: Position and Possessed name squads. (This means race profile updates as well)

2] Whenever a unit is possessing (we need a rule checking it) AND/OR it no longer exists, to check if a squad with the possessed name exists in proximity of the old one. The rule must have an interval of 0 (or 0.125 sec, since the engine makes 8 "passes" per sec: 0.125x8 = 1sec), so than NOT to mess things up, with any other possible squads!!
3] If so detected, transfer current experience to the new squad, with the appropriate adjustment factor, based on "type difference".

 

It sounds easy, and perhaps it is...

Bah, for any experienced coder, it is a piece of cake, really :p

BUT even for him, it needs time to implement.

 

If I ever do that, Experience will get an UI BAR.

Like in Warcraft III, or any other game with levels.

 

I mean, if we are to make it perfect, ... we will make it PERFECT. No compromises.




#1113977 Is it possible to switch between default wargear and upgraded one?

Posted by Gambit on 15 March 2021 - 09:51 AM

The flexibility regarding Hardpoint Swapping is limited, so I understand your decision to skip it altogether.

 

OK, so weapon upgrades were mostly intended for researches (like the plasma pistols for SMs), and squad upgrades (like Beavy Bolters for SMs). And these must be PERMANENT, the designers didn't want "rogue" modifiers fiddling with the weapons. Because it would cause ugly visual results.

That is why the designers FORBADE reverting hardpoints to previous ones.

For harpoints, there is only ONE way. Up (I mean the NEXT one, of course).

 

As for the Noice Marines Harmonics, there are a couple of things to consider:

- The actual index of each weapon is calculated INTERNALLY. Meaning that, if you have weapons only in (say) weapon_03 and weapon_07, then the engine will consider the first (the _03), as the FIRST weapon, and the second one (the _07) as the SECOND weapon. The _01 and _02 and so forth of the AE enumeration is only for the user.

(The same goes for Hardponts!)

- So, in order to swap weapons, you need to add DUMMY ones in-between, not simply "skip" entries.

- Also, using weapon_change to jump to a non-existent hardpoint (say, I have 4 weapons, and I order a weapon_change of 6), will jump to the LAST weapon in the list, of the specific hardpoint.

- Now, weapon_change swaps ALL weapons to the ordered harpoint.

 

So, in order to achieve the desired end, I HAD to enable/disable certain hardpoints, AND to make sure I added many dummy ones, so when the swap happens, NO attached leader to suffer the "swapping" effect as well!!

 

 

It is kinda like "playing with fire" :p

You must know exactly what you are doing - and in such delicate issues, only trial and error is actually what works.




#1113970 Is it possible to switch between default wargear and upgraded one?

Posted by Gambit on 14 March 2021 - 06:02 PM

Hello brother Tony33.

The only way to do that, is with the SoB emperor's touch ability mechanic you mentioned, as a TIMED ability...

Regrettably, toggle or on-demand hardpoint change does not work.

Meaning that (besides the weapon_change ability mechanic), once as hardpoint is increased by a modifier, it CANNOT go back.

It is limiting, but there is a special reason the designers decided it (I can elaborate, if you want).

 

Anyway, if you need examples on how to do it a bit differently than Vanilla, see how I coded the Harmonics ability ion Emperor's Children.

For a melee weapon alternative, have a look at the Hammerhand ability in IDH ( for that, I had to create more weapons for ALL attached commanders, because the weapon_change affects the WHOLE squad).

 

It is a bit limiting, regardless...




#1113279 Cinematic Battles

Posted by Gambit on 27 January 2021 - 04:01 PM

Hmmm....

Brother Kasrkin is the Campaign SCaR expert...

If he is not available, I will look into it, at some time in the future :thumbsuphappy:




#1112311 Cinematic Battles

Posted by Gambit on 30 November 2020 - 09:04 AM

Huge pack though!!! :thumbsuphappy:




#1110747 Quick Question on the "advanced" Build menu.

Posted by Gambit on 06 August 2020 - 03:38 PM

For a building to appear in the advanced menu, you must go into the structure_buildable_ext and set the advanced_build_option to [true].

BUT to make the advanced build button available to your builders, you NEED an UI update as well.

Because they only have the standard build button, and this does NOT include the other buildings (obviously).

 

For this, you need something like FreeUI. OR, if you have UI/Taskbar skills, you can modify the taskbar yourself :)




#1110417 Realistix Kapak Mod - Issues, Suggestions, Help

Posted by Gambit on 20 July 2020 - 01:46 PM

...what would be the "accuracy when moving"vallue of a unit if its basic 'accuracy' vallue is 0.4 and its "accuracy reduction when moving" vallue is 0.75 ?

The moving accuracy formula is : accuracy x ( 1 - accuracy when moving)

 

In your example:

0.4 is the standing shooting accuracy.

0.4x(1-0.75)= 0.1 is the moving shooting accuracy.

 

More explanation: 1-0.75, translates to: "it drops by 75%", so what remains is 100-75=25% of the original value. So you must find the 25% of the original, hence x0.25.

 

So yeah! If accuracy reduction when moving is high, you get a really high reduction!

The 0.75 is too much, so it will have the unit miss too much. If you set accuracy reduction when moving to 0.99 (TOO HIGH!), the accuracy when moving will drop very close to zero.

And as I said, if you set accuracy reduction when moving to 1, the unit will NOT SHOOT AT ALL when moving (see the heavy bolters or missile launchers of tactical marines, for example)

 

I'm not good at mathematics...

I am a physicist, and I dare say a good mathematician as well :grad:

 

 

...it seems to me that if this is a multiplication it makes no sense that the more the "accuracy reduction when moving" vallue is high, the lower the ""accuracy"" vallue will be if both are combined. But it can't be a substraction because with the example I took the final ""accuracy when moving"" vallue would be negative, and it also makes no sense.

Hehehe. Nice "deduction"!

As I said, it is multiplication, but with 1-value.

 

 

what do you call ""standard accuracy"" ?

The accuracy value  :p




#1110000 Alien Hunters - Deathwatch Development

Posted by Gambit on 02 July 2020 - 10:19 AM

Hello brother.

Well, the Alien Hunters are at alpha stage.

My initial plan was to make it THE BEST race mod there is, and our team (both 3D and Audio) is really good at it.

But... Life intervened, and other projects took precedence, and... It is now low in priority.

At the moment, I will focus on Unification (probably Last Stand), and the Tyranid Swarm race!

If you want to help us testing it, then please contact brother Unsociallobster, who is responsible for the team members (among other things!). In fact, I will uploading out LATEST TyrSwrm build today, to start preparing it for a public release.




#1104901 Scar script questions

Posted by Gambit on 25 November 2019 - 09:03 AM

Ahem....

No, this is not the "proper" way brother BloodyVomit. Although, it WILL work.

 

See, the repeat is still there, and yeah, it WILL exit eventually - but the number of loops is still random.

Just think that at the 10nth entry, there will be 9 "trues" and 1 "false" array entries, so the loop will run until that specific "false" is chosen. This is an unnecessary number of calculations.

 

If you were to:

1] remove the Repeat.

2] after each choice, instead of having the entry set to "true", just remove it from the table, and

3] choose based on this: g_random = World_GetRand(1, table.getn(t_RandomIEPlayed)) instead of this: g_random = World_GetRand(1, 10),

it would be much better!

 

And you need not use this exiting condition: if g_random_ie_counter == 10 then

But this: if table.getn(t_RandomIEPlayed) == 0 then

 

Bottomline, you do not even need to use a loop at all :p

Just delete each entry you play, and re-select from an array with "trimmed" entries, until they reach 0.

 

Just saying...