-
Posts
70 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by ErhanK
-
Ah i forgot to say something thank you I'm using this method but what about a single bone or an end-hierarchy bone?
-
Hi. Is there any way to get a bone length in a model?
-
What if i want to render extra 3rd person character mesh that is casts only own shadows and it's not visible by main FPS camera? How i can make it?
-
I'm trying to get it line by line with stop delimeter. I don't know if it exist in Stream class but simply i'm trying this.. ifstream myfile(filename); if(myfile.is_open()) { string item; string name; string type; while(!myfile.eof()) { getline(myfile,item,'|'); getline(myfile,name,'|'); while(getline(myfile,type,'|')) { cout<<type<<endl; } getline(myfile,type,'\n'); } myfile.close(); } Maybe i can do some extraction after stream->ReadLine()
-
Hi. When i'm add the fstream header to my project, i'm getting this error : 'EOF': undeclared identifier. It's happens only in leadwerk project. Why is it? I'm trying to parse a custom file like this code: entityDef weapon_shotgun { "weapon_name" "weapon_shotgun" "def_projectile" "projectile_bullet_shotgun" "ammoType" "ammo_shells" "ammoRequired" "1" "clipSize" "8" "mtr_flashShader" "muzzleflash" } so i can generate my entities from it.
-
you really must do
-
So i need this : if (PickInfo.entity->GetKeyValue("GameObjectType") == "NpcBase") { //NPC_Base is my custom actor NPC_Base* tmp = dynamic_cast<NPC_Base*>(PickInfo.entity->GetActor()); tmp->DoSomething(); } and thank you so much :)
-
I want to call the custom function in a c++ class ... I have one more question. I don't know which is better. I've created a custom actor class. This class creates an entity within itself and attaches itself to it. Should I use this, or should I create an entity, also create a custom actor and then assign that actor to that entity? I gave an example below. //Header class EnemyBaseActor : public Actor { public: EnemyBaseActor(); }; //CPP EnemyBaseActor::EnemyBaseActor(){ this->entity = Model::Load("Models/Zombie.mdl"); this->entity->SetActor(this); } OR // In the main ex. Entity* myEntity = Model::Load("Models/Zombie.mdl"); Actor* zombieActor = new EnemyBaseActor(); //My custom actor. myEntity->SetActor(zombieActor); //zombieActor->Release(); // It's doesn't work. So i didn'n write it. it works in two ways, but which one is right?
-
Hi. How can i call a custom function on my hitinfo entity? if (PickResult) { if (PickInfo.entity->GetClass() == Entity::ModelClass) { if (PickInfo.entity->GetKeyValue("GameObjectType") == "NpcBase") { //PickInfo.entity-> ?? ex. GetHurt() } } }
-
Yes sure..thank you Smoke.zip BulletHit.cpp
-
When the bullet I fired hits the wall, smoke comes out. Such a change in lights occurs throughout the lifetime of the smoke. Is this a bug or am I making a mistake? Here is my code { //initial codes up here //Smoke emitter smokeMaterial = Material::Load("Materials/Effects/smoke.mat"); hitEmitter[1] = Emitter::Create(); hitEmitter[1]->SetCollisionType(0); hitEmitter[1]->SetColor(1, 1, 1, 0.25); hitEmitter[1]->SetMaterial(smokeMaterial); hitEmitter[1]->SetEmissionVolume(0.05, 0.05, 0.05); hitEmitter[1]->SetVelocity(0.5, 0.5, 0.5, 1); hitEmitter[1]->SetParticleCount(18); hitEmitter[1]->SetReleaseQuantity(18); hitEmitter[1]->SetMaxScale(4); hitEmitter[1]->SetDuration(1500); hitEmitter[1]->AddScaleControlPoint(0, 0.7); hitEmitter[1]->AddScaleControlPoint(1, 1); hitEmitter[1]->SetRotationSpeed(8); hitEmitter[1]->SetAcceleration(0,-1.2,0); hitEmitter[1]->Hide(); hitEmitter[0]->SetParent(this->entity); hitEmitter[0]->SetPosition(0.0f, 0.0f, 0.0f, false); hitEmitter[0]->SetShadowMode(0); hitEmitter[0]->Show(); hitEmitter[0]->SetLoopMode(false, true); lifeTime = 12000; fadeTime = 4000; fadeStart = Time::GetCurrent() + lifeTime - fadeTime; } void BulletHit::UpdateWorld() { int currentTime = Time::GetCurrent(); if (currentTime > fadeStart) { float alpha = 1.0f - (currentTime - fadeStart) / fadeTime; if (alpha <= 0) { this->entity->Release(); } } }
-
Yes "pickInfo.GetSurface()->GetMaterial()->GetTexture(0)->GetPath()" this is worked. thank yo but its causing some problems. i'll think another way
-
Yes.it's returning null but how can i achive this? Can we get this information from the surface of pickinfo?
-
Hello there. I'm trying to get the texture path on pickinfo's surface. If I can get the path name, I'll specify the bullet impact effect from the postfix I added to the texture name (eg myTexture_wood or myTexture2_metal). But the nullptr value is returned. Here is my debug window. can anybody help?
-
Is it correct to add the Baked lighting map from the blender cycles as an emission and diffuse shader to the leadwerks? I tried, but there's no decal on it. How would it be? Would it give such an image? Anybody try anything like that?
-
This is my RTS project's mouse zoom code. I hope this c++ code can give you idea. float cameraDistance = 15.0f; float smoothness = 15.0f; float zoomRangeMin = 8.0f; float zoomRangeMax = 20.0f;; Vec3 playerCameraPos; Vec3 playerCameraNewPos; float scrollSpeedFPS; float mouseWheel; int getMouseWheelDirection() { int wheelReturn = 0; float mouseWheelPos = Window::GetCurrent()->GetMousePosition().z; if (mouseWheel != mouseWheelPos) { if (mouseWheelPos < mouseWheel) { wheelReturn = 2; //Wheel Down } else if (mouseWheelPos > mouseWheel) { wheelReturn = 1; //Wheel Up } mouseWheel = mouseWheelPos; } return wheelReturn; } void mouseMovement() { playerCameraPos = playerCamera->GetPosition(); playerCameraNewPos = playerCameraPos; scrollSpeedFPS = scrollSpeed * Time::GetSpeed(); if (playerCameraNewPos.y != cameraDistance) { playerCameraNewPos.y = Math::Curve(cameraDistance, playerCameraNewPos.y, smoothness / Time::GetSpeed()); } int mouseWheelDirection = getMouseWheelDirection(); if (mouseWheelDirection) { if (mouseWheelDirection == 1) { if (cameraDistance < zoomRangeMax) { cameraDistance = cameraDistance + 2; } } else if(mouseWheelDirection == 2){ if (cameraDistance > zoomRangeMin) { cameraDistance = cameraDistance - 2; } } } playerCamera->SetPosition(playerCameraNewPos); }
-
-
Thanks. I love this feature too. I had to do it.?
-
Of course. In the upper left corner there are rotation values related to the weapon.
-
Thank you?! useful information for me. it's working
-
the actual problem is here. i cant call this function.. both of them in the same class. Thanks for other reply.
-
Hi, I have a few questions. I am using C ++. 1) For example, I have a derived entity class, and I have a derived actor class attached to this class. Pickinfo gives me an entity when the bullet hits this class. I can also access the atached actor with pickinfo.entity.GetActor (). But since it doesn't give me the class and actor I've derived, I can't call the giveHurt () function in them. 2) In the documentation, the ForEachEntityInAABBDo function can be called in main (). There is no problem. But I can't call the callback function of a class. Should I use a function pointer? world-> ForEachEntityInAABBDo(aabb, &MyClass::Callback, v); it does not work. Also I cannot call the callback function with a string. I need to solve these problems so that I can continue to improve my game. I can't get enough help from the forum. I will be glad if you help me.
-
Anyway, this doesn't look odd because of the concept of my game. People can think of it as a ghost.
-
this code solved the problem // tmpX and tmpY are global float x = 0; x = mouseDifference.y / mouseSensitivity; tmpX += x; if (tmpX > 20) { tmpX = 20; } else if (tmpX < -20) { tmpX = -20; } float y = 0; y = mouseDifference.x / mouseSensitivity; tmpY += y; if (tmpY > 60) { tmpY = 60; } else if (tmpY < -60) { tmpY = -60; } //CONVERT TO VECTOR Vec2 wpnRot; wpnRot.x = tmpX; wpnRot.y = tmpY; // SMOOTING smoothWeaponViewRot.x = Math::Curve(wpnRot.x, smoothedHurtOffset.x, 5); smoothWeaponViewRot.y = Math::Curve(wpnRot.y, smoothedHurtOffset.x, 5); //THEN testWeapon->entity->SetRotation(camRotation); //PLAYER ROTATION testWeapon->entity->Turn(smoothWeaponViewRot); //WEAPON VIEW ROTATION //now the weapon can navigate within the boundaries of the player's angle of view, according to the movement of the mouse.
-
This bug occurred after upgrading to version 4.6. When I apply force to it, it seems to apply it to the object in a fixed and inverse direction.