Event:
a unit dies
Condition:
unit type of dying unit equal to militia
Actions:
set GlobalIntegerVariable[Player number of (owner of(killing unit))] = GlobalIntegerVariable[Player number of (owner of(killing unit))] +1
if (GlobalIntegerVariable[Player number of (owner of(killing...
the operator= function will not be called with
PtrCon<int> pcA;
PtrCon<int> pcB = pcA;
because you are initializing pcB,'
wich calls the constructor
for example
PtrCon<int> pcB(pcA);
is exactly the same,
so what you'll have to do is make a constructor for your
class that accepts...
Either use a macro or an inline function
Gold(Min, Max, Lvl)
Macro:
#define Gold(A,B,C) ((rand()%(B-A+1))+A+C)
Function:
inline int function Gold(int mi, int ma, int lv)
{
return ((rand()%(ma-mi+1))+mi+lv);
}
I dont want to be a noob taking down visual basic,
but im a C++ guy, and if you look at google's codesearch:
Basic/Visual Basic : 287.000 files.
C : 8.090.000 files
C++ : 11.100.000 files.
(ps. C#, wich is also for the .net framework returned 1.600.000 source files)
Basically, C and all of...
yes thats all it takes :)
the for #define and its friends you should check this out
and usually headers have this in them:
#ifndef MYHEADER_H
#define MYHEADER_H
//functions and classes go here
#endif
that is to prevent the header from being included twice
.h files that you can make are just normal code, like normal .cpp ones
for example you write some functions in a file called myfunctions.h,
then you can include it in your main file with
#include "myfunctions.h"
(note that youll have to use #include "myfunctions.h" not #include <myfunctions.h>)
only works if you use a minimum value of 1, because (for example)
"(rand()%3)+2+level" you could get a value between 2+level and 4+level, not 2+level and 3+level, youll want to use:
(rand()%(Max-Min+1))+Min+MonsterLevel