-
Posts
2,412 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Posts posted by SpiderPig
-
-
I think what I'll end up doing is releasing the instance and creating a new instance of a harvested plant.
int closestIndex = 25; if(window->keyHit(Key::E) == true){ instance[closestIndex]->Release(); instance[closestIndex] = harvestedPlant->Instance(); }
This means I could add different geometry in as well, like broken branches or something.
-
I'm creating instances of a lot of vegetation. When the player harvests a plant I wanted the material / texture to change to show it had been harvested.
Model* plant = Model::Load("plant.mdl"); Material* harvested = Material::Load("Harvested.mat"); Entity* instances[100]; //Load for(int id=0;id<100;id++) { Instances[id] = plant->Instance(); } //InGame int closestIndex = 25; if(window->keyHit(Key::E) == true){ instance[closestIndex]->SetMaterial(harvested); }
This is essentially what I'm doing except setting the material of one changes all the instances.
I can't use a copy because it can't be used in real-time. As the player moves I create the foliage around them as required.
-
Thanks. It seems that an instance can't have a separate material from the original. I guess it's kinda like not being able to alter the surface of an instance since technically the material is applied to the surface.
-
Can each instance have it's own material? I know we can edit vertex data with out it showing across all instances.
-
Yeh you will need at least 4GB to run Windows 64 and Leadwerks. I'd get more than the minimum though.
-
1
-
-
Are you running 32bit Windows or 64bit?
I think 32bit requires 1GB of RAM and 64bit requires 2GB. Your GPU and CPU seem okay.
Is that your only hard drive too? If so check how full it is, windows needs some free space to operate correctly.
-
1
-
-
That's it thanks guys! Time to math.
-
Does any one know how to get a normal that will tell the general direction all the vertices of an object lay in? Like an average position, but as a normal... any one got any ideas?
-
Thanks. It turned out to be the pick radius. Changing from 0.01f to 0.0f worked. Any idea why?
-
PickInfo.triangle returns -1 for me, and PickInfo.face is NULL. This is my code;
Vec3 _mPos = window->GetMousePosition(); PickInfo _pickInfo; if (camera->Pick(_mPos.x, _mPos.y, _pickInfo, 0.01f, true) == true) { int _index = _pickInfo.triangle; auto _face = _pickInfo.face; }
Is there a way to get this data?
-
Would be nice if World::SetAmbientLight() could take a Vec3 overload, and maybe even a Vec4.
-
1
-
-
Thanks. Working now
int _index = comboboxFullscreen->GetSelectedIndex(); bool _oldFullscreenValue = Base::Config::fullScreen; Base::Config::fullScreen = (_index == 0 ? true : false); if (_oldFullscreenValue != Base::Config::fullScreen) { Context::GetCurrent()->Release(); Window::GetCurrent()->Release(); int _xPos = (Base::Config::fullScreen == true ? 0 : Base::desktopWidth / 2); int _yPos = (Base::Config::fullScreen == true ? 0 : Base::desktopHeight / 2); auto _newWindow = Window::Create(Base::GameTitle, _xPos, _yPos, Base::Config::screenWidth, Base::Config::screenHeight, (Base::Config::fullScreen == true ? Window::FullScreen : Window::Titlebar)); auto _context = Context::Create(_newWindow); } else { Window::GetCurrent()->SetLayout((Base::desktopWidth / 2) - (Base::Config::screenWidth / 2), (Base::desktopHeight / 2) - (Base::Config::screenHeight / 2), Base::Config::screenWidth, Base::Config::screenHeight); }
-
2
-
-
Will the old context also have to be remade to point to the new window?
-
Ah okay. I use SetLayout and center the screen using (GetSystemMetrics(SM_CXSCREEN) / 2) - (newWidth / 2). SetLayout takes and x,y,width,and height arguments, but not a full screen argument. It would be nice if it did.
-
Yeah I can change the resolution while it's running, but the only option I see for setting full-screen is in the Window::Create() function. I was looking for window->SetFullscreenMode(bool) or something similar. I'm wondering if releasing the window and recreating will cause problems... I should try it...
-
Is it possible to change a window between full-screen and windowed mode while it is running? Can the full-screen window be created and then set as the default, then the old window deleted? ?
-
I created a class specifically for steam callbacks;
#header class cSteamCallbacks { private: STEAM_CALLBACK(cSteamCallbacks, _onGameOverlayActivated, GameOverlayActivated_t); public: bool steamOverlayActive = false; };
#cpp void cSteamCallbacks::_onGameOverlayActivated(GameOverlayActivated_t * pCallback) { if (pCallback->m_bActive == 1) { steamOverlayActive = true; } else { steamOverlayActive = false; } }
#App.cpp cSteamCallback* steamCallback = nullptr; bool _steamSuccess = Steamworks::Initialize(); if (_steamSuccess == true) { steamCallback = new cSteamCallback(); } #Loop if(steamCallback->steamOverlayActive == false){ //Update mouse interaction }
-
2
-
1
-
-
Yeah. I have it working now, thanks guys. Is this something you'll end up managing in the Steamworks class or you think it is best left for us to implement?
-
-
Okay I found this which is a struct;
GameOverlayActivated_t
-
Thanks. That looks to be the one but all I can find is this;
Steamworks::steamfriends->ActivateGameOverlay()
Which is just another method of activating the overlay.
-
So did I, but when its shown the mouse will remain in the centre of the screen and still move the camera.
All I'm calling at the start of the game is Steamworks::Initialize().
-
I know how to show it, what i need is a way to check if it is shown so I can disable mouse input to the game.
-
How can I check if the Steam Overlay is active? I can't see anything that looks relevant under the Steamworks class.
Load Package not keeping folder hierarchy
in General Discussion
Posted
Hi guys, I'm loading multiple packages from within sub folders and it although they are loading correctly and being password verified I cant load files from them.
The package loads from a folder in my game directory;
Loaded package! C:/Users/Matt/Desktop/The Seventh World\GameData\Icons\Icons.zip Verified!
Then I load an icon which fails;
Error: Failed to load texture "C:/Users/Matt/Desktop/The Seventh World/GameData/Icons/Bark.tex"
But this works;
Loading texture "C:/Users/Matt/Desktop/The Seventh World/Bark.tex"
It seems loading a package doesn't register itself with it's own directory but to that of the game directory? @Joshis this a bug?