Recent content by 0_Flip

  1. 0_Flip

    How to award 1 lumber for every 2 unit kills

    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...
  2. 0_Flip

    overloaded operator=

    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...
  3. 0_Flip

    [C++] How to make a gold dropping formula

    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); }
  4. 0_Flip

    Another programming question

    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...
  5. 0_Flip

    [C++] Making libraries using Devc++?

    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
  6. 0_Flip

    [C++] Making libraries using Devc++?

    .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>)
  7. 0_Flip

    [C++] How to make a gold dropping formula

    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
Top