Page 2 of 3

Re: Wyrmsun Thunder

Posted: Fri Mar 27, 2015 3:57 pm
by Kyran
Wargus Ais now work. Nephrite didn't have any trouble with me.
Nephrite.png
Nephrite.png (276.77 KiB) Viewed 11233 times

Re: Wyrmsun Thunder

Posted: Fri Mar 27, 2015 7:43 pm
by Andrettin
Kyran wrote:Wargus Ais now work. Nephrite didn't have any trouble with me.
Nephrite.png
Cool! I looked into your UI code to see why the lumber and oil icons aren't appearing, and you defined their "IconFrame" as being 1 and 2 respectively. It should be 0 for both (since they have an image file of their own, instead of being the second or third frame of an image file with all the resource icons). You also don't need to use "lumber.png" for oil: there is already an icon for oil in Wyrmsun (it is just unused at the moment). You could use "oil.png", or "fuel.png", both would fit.

Re: Wyrmsun Thunder

Posted: Mon Mar 30, 2015 11:15 am
by Kyran
Now unit-hero-female causes the game to crash. I don't see any reason why, the unit is a direct copy and past from one that works. To see the crash load up Coastal Crusade, and look at White's second herbalist.

Re: Wyrmsun Thunder

Posted: Mon Mar 30, 2015 12:42 pm
by b_o
nice, I managed to snag that WT3 file before it was removed, and it looks promising. But it crashed with a bunch of invalid map tile errors when I used it with the latest wyrmsun commit. I think that might have been caused by the maps using the forest tileset. The new seasonal tree graphic code makes old forest maps get those errors, and I'm not sure how to update the old forest maps to allow for the seasonal tree changes. If you had maps using a non-forest tileset, I would guess it wouldn't get those errors.

edit:
I made a copy of one of the new forest tileset lua's and renamed it to the old forest.lua name and it fixed the problem.

Re: Wyrmsun Thunder

Posted: Mon Mar 30, 2015 7:19 pm
by Andrettin
b_o wrote:nice, I managed to snag that WT3 file before it was removed, and it looks promising. But it crashed with a bunch of invalid map tile errors when I used it with the latest wyrmsun commit. I think that might have been caused by the maps using the forest tileset. The new seasonal tree graphic code makes old forest maps get those errors, and I'm not sure how to update the old forest maps to allow for the seasonal tree changes. If you had maps using a non-forest tileset, I would guess it wouldn't get those errors.

edit:
I made a copy of one of the new forest tileset lua's and renamed it to the old forest.lua name and it fixed the problem.
To update old forest maps it's just a matter of replacing in the map's .sms file "LoadTileModels("scripts/tilesets/forest.lua")" with "LoadTileModels("scripts/tilesets/conifer_forest_summer.lua")". To get a random season, though, replace it with this instead:

Code: Select all

if (SyncRand(2) == 0) then
	LoadTileModels("scripts/tilesets/conifer_forest_summer.lua")
else
	LoadTileModels("scripts/tilesets/conifer_forest_autumn.lua")
end

Re: Wyrmsun Thunder

Posted: Mon Mar 30, 2015 7:42 pm
by Andrettin
Kyran wrote:Now unit-hero-female causes the game to crash. I don't see any reason why, the unit is a direct copy and past from one that works. To see the crash load up Coastal Crusade, and look at White's second herbalist.
I tested it, and it seems that it is something related to units being summoned that way in general, rather than that unit type in particular. If I replace unit-female-hero with something else in the build order, it crashes too when moving the mouse towards them.

Re: Wyrmsun Thunder

Posted: Tue Mar 31, 2015 9:09 am
by Kyran
Andrettin wrote:I tested it, and it seems that it is something related to units being summoned that way in general, rather than that unit type in particular. If I replace unit-female-hero with something else in the build order, it crashes too when moving the mouse towards them.
You probably just replaced the defective unit with another defective unit. If I place unit-female-hero on a new map it still crashes. I renamed it unit-female and it works. Mm! I renamed it unit-hero and it crashes again!

OK, so the game will crash if the unit has hero in the name.

Working:
  • unit-arthor-literios
  • unit-white-mage
  • unit-flying-angel
  • unit-man-of-light
  • unit-knight-rider
Broken:
  • hero
  • unit-hero
  • unit-female-hero

Re: Wyrmsun Thunder

Posted: Tue Mar 31, 2015 8:15 pm
by Andrettin
Kyran wrote:
Andrettin wrote:I tested it, and it seems that it is something related to units being summoned that way in general, rather than that unit type in particular. If I replace unit-female-hero with something else in the build order, it crashes too when moving the mouse towards them.
You probably just replaced the defective unit with another defective unit. If I place unit-female-hero on a new map it still crashes. I renamed it unit-female and it works. Mm! I renamed it unit-hero and it crashes again!

OK, so the game will crash if the unit has hero in the name.

Working:
  • unit-arthor-literios
  • unit-white-mage
  • unit-flying-angel
  • unit-man-of-light
  • unit-knight-rider
Broken:
  • hero
  • unit-hero
  • unit-female-hero
Ah, of course! I completely forgot - Wyrmsun uses there being "hero" in the ident to see whether a unit type is a hero or not (for things like hero persistency, etc.). I changed it so that heroes are now identified by a "Hero" boolflag.

Re: Wyrmsun Thunder

Posted: Thu Apr 02, 2015 10:37 am
by Andrettin
Skype finally downloaded the messages of the last couple of days, and I saw what you mentioned about a couple of functions there now.

I made info_panel_x and info_panel_y global variables now (defined at stratagus.lua), meaning that you just need to redefine them and then load /scripts/ui.lua and it should work. For function SetupPlayer(player, race, ai, gold, lumber, oil, x, y), why don't you just redefine it in the mod's main file? That should work without any problems.

Re: Wyrmsun Thunder

Posted: Thu Apr 02, 2015 11:37 am
by Kyran
Andrettin wrote:I made info_panel_x and info_panel_y global variables now (defined at stratagus.lua), meaning that you just need to redefine them and then load /scripts/ui.lua and it should work. For function SetupPlayer(player, race, ai, gold, lumber, oil, x, y), why don't you just redefine it in the mod's main file? That should work without any problems.
Genius.

Here is another one for you.

Code: Select all

DefineSpell("spell-unit-footman",
	"showname", "Footman",
	"res-cost", {0, ftm_cost_gold[1], ftm_cost_wood[1], ftm_cost_oil[1], 0, 0, 0, 0, 0, 0},
	"range", 6,
	"target", "position",
	"action", {
		{"summon", "unit-type", "unit-footman", "time-to-live", 99000},
		{"spawn-missile", "missile", "missile-magic-effect", "start-point", {"base", "target"}}},
	"sound-when-cast", "magic-holy"
)
It works perfectly fine, but if I define another spell afterwards, its crashes.

Code: Select all

DefineSpell("spell-unit-footman2",
	"showname", "Footman",
	"res-cost", {0, ftm_cost_gold[1], ftm_cost_wood[1], ftm_cost_oil[1], 0, 0, 0, 0, 0, 0},
	"range", 6,
	"target", "position",
	"action", {
		{"summon", "unit-type", "unit-footman", "time-to-live", 99000},
		{"spawn-missile", "missile", "missile-magic-effect", "start-point", {"base", "target"}}},
	"sound-when-cast", "magic-holy"
)