Jump to content

Thirsty Panther

Developers
  • Posts

    1,278
  • Joined

  • Last visited

Posts posted by Thirsty Panther

  1. Sensei I believe I have found another test.

    In the Vector lesson should the code for a vector of integer values be 

    std::vector <int> myvector;

    and not

    std::vector myvector;

    And the code for a vector of strings should be 

    std::vector <string> myvector;

     And in Lists should we also declare which data type we are going to use.

    std::list <int> mylist;
      or
    std::list <string> mylist;

    As a general rule what are the strengths and weaknesses of arrays, vectors, maps and lists.

    I assume arrays are less memory hungry as their size doesn't change but are less flexible.

    Vectors look like they could be difficult to keep track of.

    Maps look similar to how tables work in Lua.

    • Thanks 1
  2. Thanks gentlemen for the clarification. I thought it was a cut and paste error.

    There is a couple of "s written as quote in the Loop section of the tutorial as well.

    There is also a mention of Lua in the start of the Loop tutorial, not sure if thats a cut and paste issue.

    I'm going OK just started arrays, vectors and containers. Its a bit of a step up from Lua but I'm feeling a little more comfortable with C++ than I thought I would.

     

  3. I'm working my way thru the C++ tutorials and I've gotten to the if statement part.

    #include "Leadwerks.h";
    int main(int argc, const char *argv[])
    {
        if (2>1)
        {
            Print("Two is greater than one!");
        }
    }

    Then the explanation of the code is given as.

    "The above code tests to see if two is greater than one (it is!) and then goes on to execute the code inside the statement. The statement is terminated with the "end" keyword. So we know the above code would print out the word "true" when run."

    Isn't this wrong?

    The statement end with the } doesn't it? and not the "end" keyword. 2>1 is true but would print "Two is greater than one!" as we have told it to do if 2>1.

    • Thanks 1
  4. What material do you have loaded for your Emitter?

    If you change it to "Default" do you still get the same result?

    I have made the same scene as you and it works fine. On my laptop I get 60 fps with no lag. 

    Is the material you are using a sprite sheet? In which case you will need to set up the uv animations in the emitter settings.

    P.S. I enjoy watching your videos.

  5. On 10/24/2019 at 12:32 PM, ?Yue? said:

    Thanks for the information, but that doesn't have an example. I can deduce that it sets a number as a minimum and a maximum, but I have no idea how to implement it, the translator does not help much without an example. 
     

    In your code you will want to "clamp" the self.sWheel variable.

    Math:Clamp(self.sWheel,0,30)

    You will need to alter the 0 to whatever minimum value you wish to set your zoom to.

    The 30 value will be your maximum zoom value.

    • Like 2
  6. Hard to tell without seeing your code but I'm guessing you are not resetting your variable for the key press for the first question.

    ie Question one: Answer = "F3"

    Question two: Answer = still equals "F3" from question one.

    Hope this helps.

    Good to have you back.

    • Like 1
  7. If you are using the default Monster AI script then the part you are looking for is:

     

    function Script:Hurt(damage,distributorOfPain)
    	if self.health>0 then
    		if self.target==nil then
    			self.target=distributorOfPain
    			self:SetMode("attack")
    		end
    		self.health = self.health - damage
    		if self.health<=0 then
    			self.entity:SetMass(0)
    			self.entity:SetCollisionType(0)
    			self.entity:SetPhysicsMode(Entity.RigidBodyPhysics)
    			self:SetMode("dying")
    		end
    	end
    end

    After the self:SetMode("dying") place your code to increase the number of kills.

    Kills= Kills + 1

     

  8. Thanks Catch and GC for the help.

    Turns out that Leadwerks does recognize the % as  modulo.

    So if  X%2  equals 0 then its an even number and

    if X%2 does not equal 0 its an odd number. 

    Changing the 2 to other numbers will be true if the x is a multiple of that number.

    Now back to making a hex map.

    20190511173628_1.thumb.jpg.b8c3b74d34e603776707b055a6bc5a22.jpg

    • Upvote 1
×
×
  • Create New...