Jump to content

Ma-Shell

Members
  • Posts

    371
  • Joined

  • Last visited

Everything posted by Ma-Shell

  1. Whenever you mess up your user-interface, you can also just go ahead and delete the Leadwerks-Configuration-file (on Windows this is %HOMEPATH%/AppData/Local/Leadwerks/Leadwerks.cfg)
  2. @ScottBrady C++ is also available on Steam as a DLC
  3. You put the chunk inside the if self.mode == "attack" Block. This is bound to fail. Move it outside.
  4. It has to be "self.mode" inside the UpdatePhysics()-Function (My bad ) If it still doesn't work, try printing the value of "self.removeBodyTimer" after increasing it and see, if this creates any usable information.
  5. Your EndDeath()-Function only gets called once, after the dying-animation is finnished. Assuming, you want the timer to start then, you should replace self.removeBodyTimer = self.removeBodyTimer + (Time:GetSpeed()/100) at that point by self.removeBodyTimer = 0 Then you have to increase the timer every frame and check, if its value exceeded the given threshold. So, you should move the line, you originally had into UpdatePhysics()-Function. You should have a chunk there that says: if mode == "dead" then self.removeBodyTimer = self.removeBodyTimer + (Time:GetSpeed()/100) if (self.removeBodyTimer > self.removeBodyTime) then self.entity:Release() end end
  6. Whenever you make code-changes for c++, you will have to compile yourself (usually from within code::blocks). The Leadwerks-GUI only offers an option to run the existing executable binary. This works for LUA-Projects always because the LUA-Code is not compiled into the binary and thus the actual binary doesn't change (and there is a default one from the creation of the project). EDIT: So, if you have no codechanges and compiled it once, you can use the button.
  7. Finally found some time and noticed, this also happens, if I create the source myself, without the use of EmitSound but with "Create", "SetSound" and "Play". From your statement I read, EmitSound should just be a convenient way for doing that, which makes sure, I never use a reference to the created source. The way it is currently there is absolutely no point in getting a reference to a source and use that, as you can never be sure, it does not vanish, before you use it. That fact is taking a lot of possibilities from you for actually no advantage. I can only repeat: That is, what a reference counter is for... Everyone, who needs a reference increases the refcount and when it is done, it releases it, with the last one destroying the object. So, if I need a reference, I explicitly increase the refcount and when I'm done, I release it. Meanwhile the engine increases the refcount by ONE, while it plays the sound and decreases by ONE, when it is done.
  8. I guess, there are some weird characters in your windows-username and thus also in the path of all the resources, maybe they are causing this. What happens, when you try to start the game? Is there also an empty window or an error?
  9. But the only time you would have to do any additional management is, if you want to. If you don't want additional management, you just don't get yourself a reference and don't call addRef. That's exactly the purpose of the reference-counter-concept. That's exactly, what I'm doing here but only I let EmitSound create the source for me and then get myself a pointer to that instance. Or does this problem not occur, if I create the source myself? There is no point in getting a reference to the created source, if this is the intended design, as you can not be sure, the source is still there, when you want to access it.
  10. Even if I called addRef? So it is basically impossible to find out, whether a source has finished playing.
  11. Josh, could you please confirm, whether this is the intended behavior or not. At the moment this is game breaking for me but I wouldn't want to do a (more or less dirty) workaround, if this is fixed anytime soon.
  12. It is already there: http://www.leadwerks.com/werkspace/blog/41/entry-1269-leadwerks-game-engine-for-linux-launches-on-steam/
  13. From monster.cpp the variables defined in your main.cpp are not visible (why should they be, the file is not included). Try moving the declarations of monsteriter and monsterarray to monster.h. Edit: You will have to put them at the end of the file because otherwise the class monster, which is needed, won't be defined. Also be careful to place the definition outside the class.
  14. If there was only a pointer returned, that would not be the case. IMHO the most logical way to do that would be: A pointer to the created source is returned but the refcounter is not increased. If the user wants to keep the reference, he can increase its refcounter (src->AddRef()), so it would not be automatically removed, when it finished playing (the refcount would only be decreased by 1 (Currently it isn't even possible to keep the reference any further due to the bug I reported here: http://www.leadwerks.com/werkspace/topic/10804-finished-sound-sources-are-released-every-frame/)). If the user does not add a reference, the source will be removed once it finished and the user might end up with a corrupt reference, but that would be the user's own fault.
  15. In C++ you can do emitter->EmitSound(snd); Source* s = emitter->activesources.front(); with emitter being an Entity and snd a Sound. Surely this isn't the cleanest way. I agree, it would be nice to have the actual Source returned by the Emit-Call.
  16. Hi, When a source has finished playing it gets released every frame. This is a problem, if you want to find out, if it has finished playing, as you can't keep the source (even if you add n AddRefs() for the source, the source will be gone n frames after it finished playing). You can see this by adding a global static variable: [App.h add as class-member] static Source* src; [App.cpp] Source* App::src; [App.cpp: App::Start()] Sound* s = Sound::Load("Sound\\Footsteps\\jump.wav"); Entity* e = world->entities.front(); e->EmitSound(s); src = SoundDriver::GetCurrent()->sources.front(); src->AddRef(); src->AddRef(); src->AddRef(); src->AddRef(); [App.cpp: App::Loop()] printf("Time: %f, Refs: %i\n", src->GetTime(), src->GetRefCount()); Will lead to the following output: (...) Time: 0.074989, Refs: 5 (...) Time: 0.000000, Refs: 5 Time: 0.000000, Refs: 4 Time: 0.000000, Refs: 3 Time: 0.000000, Refs: 2 Time: 0.000000, Refs: 1 And an access violation after that, when accessing the GetTime()-method of the source. The expected behaviour would be, that the RefCount is decreased only once, so if I added Refs before, I have to release it myself. I even tried, setting "src->autorelease = false" but that didn't change anything.
  17. When I place those shaders in the corresponding folder of the template project, update my project and restart Leadwerks, the problem is gone. So it seems, Josh forgot to add them to the standalone-version.
  18. Standalone here, problem still persistent. As mentioned, I think, the modified shaders aren't downloaded, as they are from april. Even if I run the updater, it says, everything is up to date.
  19. I also get those errors. It seems, like you forgot to upload the new shaders, as the two you mentioned (at least in my template-project) are from April and if I hit update in my project, svn as well doesn't find any changes to the shaders
  20. Just replace if Math:Round(self.selected:GetRotation(true).x) == self.rotAngle.x By if Math:Abs(self.selected:GetRotation(true).x - self.rotAngle.x) < threshold Where you have to choose an acceptable threshold
  21. As far, as I understand the question, the problem seems to be, OP wants the files to be present to every project he has. I assume, placing your assets within your LeadwerksInstallDir\Templates\Common folder will make them available in every project you create afterwards, as this folder seems to simply be copied.
  22. I would guess, they are in object space. In that case you would have to multiply them by the transformation matrix of your entity.
  23. This disables the usage of external libraries and some packages that might be dangerous. If you want to publish to the steam-workshop, you have to use this, I think. For further information see: http://www.leadwerks.com/werkspace/blog/1/entry-1221-publish-your-games-directly-to-steam-with-the-leadwerks-game-player/
×
×
  • Create New...