|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted April 23, 2016 08:32 AM |
|
|
Quote: Making the code for displaying units order in battle was difficult? I just realised that in ERM this is quite impossible task.
That's because ERM was not made for complex widgets and algorithms
Can't now even tell who is the author of Stack Queue. In the past there were some issues, but it's all about good project design.
____________
The future of Heroes 3 is here!
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 23, 2016 11:40 AM |
|
|
Where can we consult this queue code?
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted April 23, 2016 12:24 PM |
|
|
The GUI code is here.
The actual queue calculation is here.
Also, queue->update() is called in a few different placed in battle mechanics (construction, stack removed, stack activated, battle action started, battle action ended).
____________
The future of Heroes 3 is here!
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 23, 2016 01:07 PM |
|
|
|
AVS
Hired Hero
|
posted April 24, 2016 08:44 PM |
|
|
Salamandre said: Making the code for displaying units order in battle was difficult? I just realised that in ERM this is quite impossible task.
Such comparison does not make any sense. The design is completely different.
Here is code from VCMI, How it can help you to implement this with ERM?
Quote:
void CStackQueue::update()
{
stacksSorted.clear();
owner->getCurrentPlayerInterface()->cb->battleGetStackQueue(stacksSorted, stackBoxes.size());
if(stacksSorted.size())
{
for (int i = 0; i < stackBoxes.size() ; i++)
{
stackBoxes->setStack(stacksSorted);
}
}
else
{
//no stacks on battlefield... what to do with queue?
}
}
CStackQueue::CStackQueue(bool Embedded, CBattleInterface * _owner)
:embedded(Embedded), owner(_owner)
{
OBJ_CONSTRUCTION_CAPTURING_ALL;
if(embedded)
{
bg = nullptr;
pos.w = QUEUE_SIZE * 37;
pos.h = 46;
pos.x = screen->w/2 - pos.w/2;
pos.y = (screen->h - 600)/2 + 10;
}
else
{
bg = BitmapHandler::loadBitmap("DIBOXBCK");
pos.w = 800;
pos.h = 85;
}
stackBoxes.resize(QUEUE_SIZE);
for (int i = 0; i < stackBoxes.size(); i++)
{
stackBoxes = new StackBox(embedded);
stackBoxes->moveBy(Point(1 + (embedded ? 36 : 80)*i, 0));
}
}
CStackQueue::~CStackQueue()
{
SDL_FreeSurface(bg);
}
void CStackQueue::showAll(SDL_Surface * to)
{
blitBg(to);
CIntObject::showAll(to);
}
void CStackQueue::blitBg( SDL_Surface * to )
{
if(bg)
{
SDL_SetClipRect(to, &pos);
CSDL_Ext::fillTexture(to, bg);
SDL_SetClipRect(to, nullptr);
}
}
void CStackQueue::StackBox::showAll(SDL_Surface * to)
{
assert(stack);
bg->colorize(stack->owner);
CIntObject::showAll(to);
if(small)
printAtMiddleLoc(makeNumberShort(stack->count), pos.w/2, pos.h - 7, FONT_SMALL, Colors::WHITE, to);
else
printAtMiddleLoc(makeNumberShort(stack->count), pos.w/2, pos.h - 8, FONT_MEDIUM, Colors::WHITE, to);
}
void CStackQueue::StackBox::setStack( const CStack *stack )
{
this->stack = stack;
assert(stack);
icon->setFrame(stack->getCreature()->iconIndex);
}
CStackQueue::StackBox::StackBox(bool small):
stack(nullptr),
small(small)
{
OBJ_CONSTRUCTION_CAPTURING_ALL;
bg = new CPicture(small ? "StackQueueSmall" : "StackQueueLarge" );
if (small)
{
icon = new CAnimImage("CPRSMALL", 0, 0, 5, 2);
}
else
icon = new CAnimImage("TWCRPORT", 0, 0, 9, 1);
pos.w = bg->pos.w;
pos.h = bg->pos.h;
}
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 24, 2016 08:56 PM |
|
|
It makes sense for me to see it properly done, thanks.
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted April 25, 2016 07:49 AM |
|
|
Well, this is simply taking bitmaps and bliting them in correct positions.
The more interesting part is stack order calculation, however that other part is not the clearest code I've seen in my life.
____________
The future of Heroes 3 is here!
|
|
rottenvenetic
Known Hero
Derusticated
|
posted April 25, 2016 03:10 PM |
|
|
Hi, I'm just starting to figure the basics of VCMI out. Is there any way to stop it from putting files in the My Documents folder on the system drive? I really don't want to sift through there.
____________
In the darkness, a blind man is the best guide; in an age of madness, look to the madman to lead the way.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 25, 2016 03:22 PM |
|
|
Warmonger said: Well, this is simply taking bitmaps and bliting them in correct positions.
Hehe, yes bitmaps are easy once you have the stack type -just you dig in the cprthing.defs, the hard part is indeed stacks order, that puzzled me a lot.
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted April 25, 2016 05:51 PM |
|
|
rottenvenetic said: Hi, I'm just starting to figure the basics of VCMI out. Is there any way to stop it from putting files in the My Documents folder on the system drive? I really don't want to sift through there.
This is where VCMI keeps settings and installed mods on Windows. You can also keep own mods in local folder where VCMI is installed.
____________
The future of Heroes 3 is here!
|
|
rottenvenetic
Known Hero
Derusticated
|
posted April 25, 2016 09:39 PM |
|
|
Understood. Can I tell it to schlep them somewhere else?
____________
In the darkness, a blind man is the best guide; in an age of madness, look to the madman to lead the way.
|
|
Lord_Immortal
Famous Hero
DoR Dev Team
|
posted May 24, 2016 11:56 PM |
|
|
I have a question, is it be possible with VCMI to add new spell schools (& respective skills for these schools)?
|
|
Macron1
Supreme Hero
|
posted May 25, 2016 10:19 AM |
|
|
Lord_Immortal said: I have a question, is it be possible with VCMI to add new spell schools (& respective skills for these schools)?
There is one person that worked on secondary skills modding system. But I don't know current status.
About schools I asked. Think, that this can be easily programmed, if someone with take this feature to implement. It's only a matter or adding new bookmarks to spell book.
|
|
engwathang
Adventuring Hero
|
posted June 07, 2016 11:10 PM |
|
|
Any awesome news about VCMI?
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted June 08, 2016 07:23 AM |
|
|
|
DarkEmblem
Tavern Dweller
|
posted June 19, 2016 05:22 PM |
|
|
- The AI just creates heroes with only one stack of units. They don't have any heroes which carry more than 3 creature stacks.
-After assigning a second item to a commander, the game crashes (dragging and dropping an item on the commander button)
-My commander doesn't earn experience.
If it helps, there are a few crashdmps here:
http://www.mediafire.com/download/6nvul18xyc1br83/Crashdmp.rar
How do I fix these?
PS: The latest download release says 0.97, while the newest is 0.98g.
(Report a bug link doesn't work)
____________
|
|
avatar
Promising
Supreme Hero
|
posted June 19, 2016 09:37 PM |
|
|
VCMI Team is not interested in WoG developing, so we must remain with commanders bugs.
____________
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted June 19, 2016 09:52 PM |
|
|
It's more about players not interested in WoG development. Until last few weeks there were no bug reports or requests concerning WoG features. No mods for it, either.
____________
The future of Heroes 3 is here!
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted June 19, 2016 10:00 PM |
|
|
|
avatar
Promising
Supreme Hero
|
posted June 19, 2016 10:42 PM |
|
|
Warmonger said: It's more about players not interested in WoG development. Until last few weeks there were no bug reports or requests concerning WoG features.
Still, reported bugs seem to pass unnoticed/unconfirmed.
http://bugs.vcmi.eu/view.php?id=2439
http://bugs.vcmi.eu/view.php?id=2430
It's regression. These features worked fine in earlier versions.
____________
|
|
|