Jump to content

Some modding questions


Phoenix4646
 Share

Recommended Posts

The skirmishreplacers are completely changed. Nowadays they are defined in the civil .json files. This is far more convenient.

I think playing around with unit classes could work but I'm not sure since I don't know the exact look of your units. Could you upload a zip with your mod?

  • Like 1
Link to comment
Share on other sites

Sorry for the late reply, I was busy doing some other things.

Oh, oops... I even checked the civs before and only found it now after you've told me. I don't know how I missed that...

Sure, I can upload it - but please ignore that it is mostly unfinished :]

Will do that later. I don't want everyone to have it right now though, is it okay if I password-protect the archive?

lion.kanzen, did you refer to my profile picture? Thanks then :) Did the best I could.

Here are some screenshots:

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/0ad_10-02-2014_0001.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/0ad_10-02-2014_0002.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/0ad_10-02-2014_0003.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/0ad_10-02-2014_0004.jpg

Older shots:

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0003.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0004.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0009.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0011.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0014.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0012.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0020.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0021.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0022.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0023.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0024.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0025.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0017.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0030.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0031.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0032.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0033.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0034.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/ancemp/oldscreenshot0013.jpg

Edited by Phoenix4646
Link to comment
Share on other sites

You also can PM me if you like keep it hidden for the time being...

No worries, I've seen multiple unfinished mod projects (no wonder either, taking into account that I'm a modder myself and involved in multiple projects)

Edited by niektb
  • Like 1
Link to comment
Share on other sites

  • 3 months later...
Link to comment
Share on other sites

Am I missing something or is something wrong on 0ad's scripting part?

Seems like you're the first one testing this to this extent. Looks like the actual actor isn't copied over for Fogging (there is no way to do this currently, but it should be trivial to add), while the techs are not applied in the preview and corpse cases because we do not send messages for local entities to scripts that globally subscribed to that message (to prevent them from picking up non-network-synchronized data). I'll open a ticket. EDIT: #2907
Link to comment
Share on other sites

Ah, alright then. Better ask first before opening a ticket :P

Well, and then there's another thing with techs setting RequiredXP to 0 (e.g. promote units permanently). If I research an upgrade that promotes a certain type of unit and then somehow get control of a pre-stage unit (e.g. I can create advanced hoplites and get a basic one from the enemy by using the convert cheat), the experience points bar glitches and stretches across the screen (similar to the tech bug that has been reported in a ticket some months ago and which got fixed). Now this is a scenario that is very unlikely to happen in 0ad since you don't convert units, but how can I fix the display myself? I know that it happens because it tries to show 0 / x on a bar that is 0 points long and thus it stretches endlessly. Maybe I can force the display (*only* the display) to use the value 1 instead if RequiredXP is 0 and then fill the bar up?

Tested in most recent SVN version with a mod that adds the promotion techs back to the barracks queue:

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_requiredxp_visbug_01.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_requiredxp_visbug_03.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_requiredxp_visbug_04.jpg

Also, these converted units cannot be promoted in any way (since the requiredXP stuff is bugged on this one it cannot correctly promote them)

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_requiredxp_visbug_02.jpg

It says the unit has 10 / 0 requiredXP but it doesn't promote it.

One way to do it would be just to promote converted units if the new owner has the particular upgrade researched. But I'd rather have it like this, converted units stay like they are and get all the other techs (damage/armor/hp upgrades, speed etc. and whatnot). Instead in this case I'd like the unit to get promoted if it kills any kind of unit (gets any amount of XP).

PS:: Just wanted to say: some very minor things I noticed

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_workercarrying_01.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_workercarrying_04.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_workercarrying_07.jpg

The workers are using the carry animations even though they don't carry any resources. Can be reproduced by selecting multiple workers and sending them to get resources. Then when all of them carry resources, tell them to drop them off. Do that by rapidly clicking on the town centre / storehouse / farmstead (for whatever resource they are carrying) and keep clicking until all of them have dropped the resources off. If you make them walk now, they still look like they're carrying stuff.

And this:

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_workerturn_01.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_workerincorrectrot.jpg

Incorrect rotation of workers when the resource is directly at a drop off structure :P

Link to comment
Share on other sites

The attached patch only promotes units that are newly created or already owned by the player when the technology is researched.

I'm not really sure what way we should prefer for the game (though I agree that promoting units upon conversion is strange) (the other possible change is just adding a message handler for ownership changes and calling IncreaseXp(0)).

The attached patch might also lead to strange behaviour if there are multiple promotion techs that build upon each other and only include the (n-1)th rank. That way you could research the first promotion tech, then convert an entity and after that research the second promotion tech and the entity would remain at rank one. Up until it gets a normal promotion where it will go straight to rank 3.

Some discussion about how we want to handle techs in the context of conversions would be nice as currently we seem to have some mixed behaviour (with some components applying changes on-the-fly) and others caching them and only changing values if they get a ValueModification message.

Is the third issue easily reproducible? Can you please create a ticket with instructions on how to reproduce that?

The last issue reminds me of a bug we had with some interpolation optimization code some time ago, but those changes were reverted. Is this easily reproducible? Again a ticket would be nice.

promote_later.diff

Link to comment
Share on other sites

No problem, I'll open a ticket for each issue.

Btw., all of a sudden promotion of converted units works like a charm (without having modified Promotion.js) which confuses me because it didn't work before as you can see on the screenshot.
Also I managed to make a temporary workaround for the visual bug. All I did was editing GuiInterface.js in lines 520 to 527:

var cmpPromotion = Engine.QueryInterface(ent, IID_Promotion);if (cmpPromotion){	var bugreqxp = cmpPromotion.GetRequiredXp();	if ( cmpPromotion.GetRequiredXp() == 0)	{		bugreqxp = cmpPromotion.GetRequiredXp() + 1;	}	ret.promotion = {		"curr": cmpPromotion.GetCurrentXp(),		"req": bugreqxp	};}


I simply add +1 to the shown RequiredXP amount if it is 0 and there you go, it acts as if the unit needs 1 XP to advance (although I still would prefer it to still say x / 0 and make only the bar think that requiredXP is 1, but as a beginner I got to take a closer look on that).

PS: And while I'm at making tickets, I'll also make a ticket of this:

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_herostar_01.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_herostar_02.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_herostar_03.jpg

https://dl.dropboxusercontent.com/u/93679544/Screenshots/0%20AD/issues/0ad_herostar_04.jpg

Garrisoning a hero inside a building lets the star stay exactly where the unit was before it went inside the structure.

EDIT:: There they are :)

http://trac.wildfiregames.com/ticket/2909

http://trac.wildfiregames.com/ticket/2910

http://trac.wildfiregames.com/ticket/2911

Edited by Phoenix4646
Link to comment
Share on other sites

I'm still able to reproduce the bug with the steps you listed above, did you change anything else?

You could just use

cmpPromotion.GetRequiredXp() || 1
but that is a workaround for a bug, nothing else. The issue is that the requiredXp apply the tech change, while nothing calls IncreaseXp(). See the patch above, and the other possibility listed in that post.
Link to comment
Share on other sites

Yeah, I'm aware that it's only a temporary workaround. I was talking about a workaround for the GUI problem only (the experience bar that expands endlessly when RequiredXP is 0). I just felt like saying what I've done because I thought it might help others for the time being, you never know :)

I cannot get the promotion bug to happen again though. Once a converted unit kills anything (= gains some XP) he gets promoted. Maybe when I took the screenshot I converted a slinger that already had gotten XP prior to converting. Or were you unable to get them promoted afterwards? I'm absolutely sure that I haven't changed anything since I'm testing that without mods (except the mod that adds the promotion tech back in the game so I could test it).

And sorry about the duplicate.

Link to comment
Share on other sites

Ah, I just misunderstood you. Yes, the unit must have gained the XP before being converted (else it would have been promoted).

The GUI problem is only the visible manifestation of a simulation issue which shouldn't happen in that way (but does because we mix two different ways to handle technolgies on ownership changes).

Link to comment
Share on other sites

I haven't implemented anything related to converting yet, I've only been messing around with the convert cheat for testing stuff and then I noticed the experience bar thing. But if I ever plan on adding conversion I think it'd be useful if some stuff already worked :P

I didn't even know about that mod. For how long has that one been around?

Link to comment
Share on other sites

  • 1 month later...

In that case I can help you. For the map 'A Silent Day In Gaul' I needed the player to be in a later Phase to allow him to build a Civic Center. I doubt it is the most elegant way to do so but it works.

var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager);var playerEnt = cmpPlayerManager.GetPlayerByID(1);var technames = ["phase_town_generic", "phase_city_gauls"];var cmpTechnologyManager = Engine.QueryInterface(playerEnt, IID_TechnologyManager); for(var i = 0; i < technames.length; i++) {	var template = cmpTechnologyManager.GetTechnologyTemplate(technames[i]);	// check, if technology is already researched	if (!cmpTechnologyManager.IsTechnologyResearched(technames[i]))		cmpTechnologyManager.ResearchTechnology(technames[i]); }

At the second line the playerID is defined (player 1 in my case). At the 4th line the to be researched techs.

Your full trigger code would then be something like this:

Trigger.prototype.ResearchStartingTechs = function() {	var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager);	var playerEnt = cmpPlayerManager.GetPlayerByID(1);	var technames = ["phase_town_generic"];	var cmpTechnologyManager = Engine.QueryInterface(playerEnt, IID_TechnologyManager); 	for(var i = 0; i < technames.length; i++) {		var template = cmpTechnologyManager.GetTechnologyTemplate(technames[i]);		// check, if technology is already researched		if (!cmpTechnologyManager.IsTechnologyResearched(technames[i]))			cmpTechnologyManager.ResearchTechnology(technames[i]); 	}};var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger);cmpTrigger.DoAfterDelay(0, "ResearchStartingTechs", {});

Edit: forgot argument in latest line.

Edited by niektb
  • Like 1
Link to comment
Share on other sites

Works like a charm, thanks a lot! :)

While talking about civic centres, are Or-requirements for templates similar to technology requirements possible yet? I'd like to be able to build only one civic centre when I got none and as many as I want once I reach the third phase.

Also I'm looking for the file where the standard playercolors are set because I'd like to adjust some of them and I've been searching through a lot of files but found nothing.Where are they located at?

And what about unit limits? How can I set up a units' / buildings' limit so it can only be created x times at the same time? I've only seen the BuildRestrictions and TrainingRestrictions stuff which included setting a category, but I'd be thankful if someone could explain how this works.

Link to comment
Share on other sites

[...]

And what about unit limits? How can I set up a units' / buildings' limit so it can only be created x times at the same time? I've only seen the BuildRestrictions and TrainingRestrictions stuff which included setting a category, but I'd be thankful if someone could explain how this works.

You mean like only have one hero at a time? Look at simulation/templates/special/player.xml

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...