Jump to content

Mumbles

Members
  • Posts

    691
  • Joined

  • Last visited

Posts posted by Mumbles

  1. Use scale instead of "scale to" scale to means rescale it to fit within the new values, so 1.5 1.5 1.5 means that if it was 10x10x10 before, it wall scale them by 0.15 0.15 0.15 their original sizes to make it 1.5x1.5x1.5

     

     

    Or I suppose, easier put, scale is relative, scale to is absolute...

  2. I didn't think LE 2 load scene returned anything, but once done, you could then do CountChildren() on the scene (everything it loaded was a child) and then use GetChild for each of these children to access each entity (GetChild returned a TEntity type)

     

    Obviously have no idea how this translates into Leadwerks 3 but in LE 2, LoadScene returned nothing. However there was a tutorial where it guided you through the process of writing a ProcessScene() function to get the children.

     

     

    Edit: Actually no, I lie, You passed it a string, it returned a TScene object, which you then called CountChildren() on

  3. This was the one of the reasons users like Pixel Perfect and Scarlet thread with the currently offered Leadwerks 3.

     

    Oh, this doesn't make any sense does it? I meant it to say

     

    This was the one of the reasons users like Pixel Perfect and Scarlet Thread were disappointed with the currently offered Leadwerks 3.

     

    And whilst I'm about it, I should say I believe they were disappointed - for this reason amongst others

  4. The only reason I upgraded from XP to 7 was because my new PC had 16GB RAM. Win7 is still horrible and slow, but at least it can use my RAM

     

    I did the same in 2008. Had a Windows XP computer, and a Windows 2000. I got a quad core AMD Phenom processor, but each of these Windows version were locked to 2 CPUs each (physical or logical), I would have to upgrade to Vista or newer. So I upgraded Windows 2000 ... to Debian Linux. The version at that time did support it, but the system clock counted twice as fast as it should have done. There was no excuse for it because Debian has been running in data centres for years, with servers having hundreds if not thousands of physical and logical CPUs, but a few months later they fixed it.

  5. ..im sorry if my question may sound rude, but, are you a lady ??

     

    I'll answer this one quite clearly on his behalf... No way

     

     

    At least here we have admin warnings (that i follow).

     

    Can't say I've ever had an admin warning here. If you've had one here then perhaps it's something to look into, it might help you elsewhere

     

    And people saying i post too much (what i try to follow these days, and i will try to remember)

     

    Well, I did find it funny you mentioned how easy Leadwerks 3 was in the "LE3 adverts" thread, and then followed up by asking at least 30 odd questions in the programming section on things which sound rather simple. But that's a guess because I don't own LE 3.

     

    And at least , what im' sure with LE 3 is we won't wait 1 or 2 years for some promised stuff or written in some rodamap? i hope biggrin.png

     

    I don't see you won't be waiting. Back in 2009 when we moved off the old forum, there was a lot of talk about what the new engine was going to be. There was no talk of mobile back then. It had never been said for sure, but it was always suggested it was about 18 months away from being finished. So late 2010 to early 2011 is when we expected it. Things go wrong, and projects overrun, that's normal. In fact waiting until 2013 wasn't a problem for most of us.

     

    But now, stuff which back in 2009 was promised to be in from the start, isn't... And we're going to be waiting 9 to 15 months before we're going to get that in the form of an upgrade we have to pay for. This was the one of the reasons users like Pixel Perfect and Scarlet thread with the currently offered Leadwerks 3. They had other things going on in life too, but this super dooper engine they'd waited for, turned out to not be so super dooper after all. If these missing features had been put back once, they can be put back again.

  6. How did you write the bootable USB drive? Just copying the files over in Windows Explorer will often will often lose it's "bootableness" if that's a real word.

     

    My awful netbook never seems to allow USB booting even though it says it does. I've got USB sticks that boot on some computers, but the netbook totally refuses. If it's like that, then all you can do is plug an external disc drive.

     

    My normal method (would need Linux) to create bootable USB sticks would to insert the Windows CD into the drive and dd it to an image file, then dd the image file directly to the USB drive (NOT to one of its partitions). Wikipedia dd entry

     

     

    Back the USB drive up first and exercise extreme caution - dd has has many nicknames, including "disk destroyer" and "destroyer of disks" etc. So if that sounds a bit dangerous, you may want to research a different method - that's just how I would normally do it.

  7. Another hint: in the projects settings you can choose which compiler to use. So you can still use vs2010 or vs2008 compilers.

     

    To use the older compilers, don't you need the older versions installed?

     

    Makes no difference to me, I'm an XP'er, but I know code blocks also allowed you to use VS2005 and VS2008 compilers, but you had to have them installed to do that. But that's probably down to copyright. Microsoft shouldn't have that problem because it's their product so I don't know.

  8. From XP and Vista times it was just a case of downloading GParted Live to a disc (it's a bootable image) then telling it to format the partition containing the bootsector. Then, presumably you would insert your Windows 7 CD because without any boot information on the hard drive it will probably go into the installer, where you should be able to install Windows as if there was nothing on the computer. Obviously your disc needs to be a retail or OEM disc, and not an upgrade (if they still do them), and you'll need a code that isn't in use. Certainly in the old days, retail, upgrade and OEM all had different product registration keys and weren't interchangeable with each other.

     

    Just a warning though, a laptop may require an additional driver for the hard drive. If you put her exact laptop model number into google along with Windows 7 downgrade or dual boot, other people who have already tried this may know whether such a driver is needed, and where to get it. If it's needed you won't be able to install Windows without it, so definitely check that out before formatting the boot partition.

     

     

    GParted Live understands ntfs-3g and had no trouble with Vista back in those days, but if Microsoft have updated the NTFS spec since then, it may not be able to fully understand (if at all) any such partitions (although it can always delete them, and let the Windows 7 installer put new ones in). However it definitely does understand the GPT partition table, which I believe Microsoft have finally caught up with and moved on to. I've been using GPT on Linux for years and the most observable difference is that there are no extendeds and logicals any more, it's primaries only, but there is no longer a limit of 4. I believe Windows 7 onwards uses GPT because of something to do with secure boot. I don't think secure boot works with the older ms-dos partition table, if I understood it right.

     

    In any case, more reading needed. I can only extrapolate my knowledge of doing this sort of thing from Vista to XP. It may still apply, it may not, but there's a starting point.

  9. Is there any sensitive data on the disk(s)? As in, is your friend particularly against nuking the drive? (Probably best to check first...) The way you say downgrade as opposed to dual boot, implies win 8 is totally unwanted on the system...

  10. I don't see why hidden would mean exemption from collisions. In half life they used to place invisible ramps on staircases so you could walk up them without the "climbing effect" which Valve considered disorientating. Is there no way to edit collision pairs between groups in LE 3? LE2 had it, but I suspect only because it was a part of Newton.

  11. huh? isn't that what the showcase forum is for?

     

    Glancing back to old TGC times, I would have thought showcase forum would be better suited to actual completed products that you want to show off. Maybe there should be an completely dedicated work in progress board here.

  12. Source code if you really want it, but really, everything is in the one source file. It's all in the last post, but that scroll bar makes it a bit harder to read...

     

    Minor typo, but not serious. the int main has it's first value of "int argcn". It shouldn't say 'n' at the end, but there's no way I'm editing that post, otherwise I'd have to format that big block of code all over again - no thanks.

  13. You want a timer that automatically calls a function when it reaches zero? That's soooo simple, all you need all you need is some uh, basic knowledge of multithreading and function pointers laugh.png

     

     

    Basically, I have a struct that contains:

    a number of milliseconds to run for,

    a control bool to abort the timer (set it to false at any time, when the timer next hits zero, it won't do anything, and will instead end the thread)

    a number of timer to run the timer, (0 for unlimited)

    Then a function pointer to the function it will call

    and a void pointer containing the parameters to pass to the function

     

     

    Then there is a function called TimerThreadFunction, but you never call this yourself. When you call StartTimerThread, that will call _beginthreadex which spawns a new thread, the entry point (like your main() is TimerThreadFunction. It uses the struct (pass is by pointer) to determine how long it would wait for, which function it should run when finished, and how many times it should run the timer.

     

    When it has run enough times (or if you set the stop timer value to true in your main loop), it will end the thread.

     

     

    PrintToScreen() and ChangeVarVal are two different functions that the timers can use. The way I designed it, any void function with a void * parameter can be called by the timer thread. PrintToScreen shows the timer working totally multithreaded. ChangeVarVal just changes a bool value, and we check this value in the main loop, this is more suitable if for LE 2 commands, since you cannot call them inside another thread

     

     

    Finally, there is the main function, which just shows it in action. First, it does PrintToScreen multithreaded, then it does ChangeVarVal single threaded, then it does PrintToScreen multithreaded again, but with an infinite count, and the main loop aborts the timer after a short time...

     

    #include <iostream>
    #include <process.h>
    #include <windows.h>
    
    struct ThreadLaunchArgs
    {
       unsigned int WaitMillis;
       bool StopTimer;
       unsigned int RepeatCount; //0 = infinite... can only be stopped with the above bool
       void (*FuncToCall)(void *);
       void * FuncToCallArgs;
    };
    
    unsigned __stdcall TimerThreadFunction( void * ArgList )
    {
       ThreadLaunchArgs * ArgsList = ( ThreadLaunchArgs * ) ArgList;
    
       if( ArgsList->RepeatCount != 0)
       {
           for ( unsigned int CurrentRepeat = 0 ; CurrentRepeat < ArgsList->RepeatCount ; CurrentRepeat += 1)
           {
               Sleep( ArgsList->WaitMillis );
               if ( !ArgsList->StopTimer )
                   ArgsList->FuncToCall( ArgsList->FuncToCallArgs );
               else
                   CurrentRepeat = ArgsList->RepeatCount;
           }
       }
       else
       {
           while ( !ArgsList->StopTimer )
           {
               Sleep( ArgsList->WaitMillis);
               if ( !ArgsList->StopTimer )
                   ArgsList->FuncToCall( ArgsList->FuncToCallArgs );
           }
       }
    
       _endthreadex( 0 );
       return 0;
    }
    
    HANDLE StartTimerThread(ThreadLaunchArgs * TimerArgs)
    {
       HANDLE hThread;
       unsigned threadID;
       hThread = (HANDLE)_beginthreadex( NULL, 0, &TimerThreadFunction, TimerArgs, 0, &threadID );
       return hThread;
    }
    
    void PrintToScreen ( void * MillisDelay )
    {
       unsigned int * Value = (unsigned int *) MillisDelay;
       std::cout << "Fire and forget timer, with delay of " << *Value << " millis has expired!\n";
       return;
    }
    
    void ChangeVarVal ( void * Flag )
    {
       bool * Value = (bool *) Flag;
       *Value = true;
       return;
    }
    
    int main( int argcn, char* argv[])
    {
       unsigned int NumRepeats = 10, TimerMillis = 2000;
       ThreadLaunchArgs * TimerArgs = (ThreadLaunchArgs *) malloc (sizeof (ThreadLaunchArgs));
    
       TimerArgs->FuncToCall = &PrintToScreen;
       TimerArgs->FuncToCallArgs = &TimerMillis;
       TimerArgs->RepeatCount = NumRepeats;
       TimerArgs->StopTimer = false;
       TimerArgs->WaitMillis = TimerMillis;
    
       //Fire and forget timer - will automatically call the selected function when the timer expires
       HANDLE FirstTimerThreadHandle = StartTimerThread(TimerArgs);
       Sleep(5000);//Main thread does nothing for 30 seconds - notice how the console window still fills up
       //For 20 seconds, the counter will work, then for the next 10, nothing will happen.
       //You can make things interesting by sleeping for less timer, like only 5 seconds
    
    
    
    
    
       //Perhaps we don't want to work multithreaded... Maybe we are calling LE 2 commands, which won't work in another thread. We'll operate psuedo single threaded instead
       //The second thread will set a flag value. We check it in this thread's loop, and when it's true, we do "stuff"
    
       bool * TimerFlag = new bool();
       *TimerFlag = false;
    
       ThreadLaunchArgs * SecondTimerArgs = (ThreadLaunchArgs *) malloc (sizeof (ThreadLaunchArgs));
    
       SecondTimerArgs->FuncToCall = &ChangeVarVal;
       SecondTimerArgs->FuncToCallArgs = TimerFlag;
       SecondTimerArgs->RepeatCount = NumRepeats;
       SecondTimerArgs->StopTimer = false;
       SecondTimerArgs->WaitMillis = TimerMillis;
    
       unsigned int CurrentRepeatCount = 0;
    
       //Monitored timer - will still count but it will instead set a value that we must check in this thread
       HANDLE SecondTimerThreadHandle = StartTimerThread(SecondTimerArgs);
       while( CurrentRepeatCount < 10 )
       {
           if( *TimerFlag )
           {
               *TimerFlag = false;
               CurrentRepeatCount += 1;
               std::cout << "Monitored timer, with delay of " << TimerMillis << " millis has expired!\n";
           }
       }
    
    
    
    
    
       //In the final example, the timer repeats forever, and we stop it ourself with the bool value
    
       ThreadLaunchArgs * ThirdTimerArgs = (ThreadLaunchArgs *) malloc (sizeof (ThreadLaunchArgs));
    
       ThirdTimerArgs->FuncToCall = &PrintToScreen;;
       ThirdTimerArgs->FuncToCallArgs = &TimerMillis;
       ThirdTimerArgs->RepeatCount = NumRepeats;
       ThirdTimerArgs->StopTimer = false;
       ThirdTimerArgs->WaitMillis = TimerMillis;
    
       HANDLE ThirdTimerThreadHandle = StartTimerThread(ThirdTimerArgs);
    
       Sleep(20000);
       ThirdTimerArgs->StopTimer = true;
    
    
    
    
       WaitForSingleObject(FirstTimerThreadHandle,INFINITE);
       CloseHandle(FirstTimerThreadHandle); //It has a return value, but if it fails, just end the process anyway...
    
       WaitForSingleObject(SecondTimerThreadHandle,INFINITE);
       CloseHandle(SecondTimerThreadHandle);
    
       WaitForSingleObject(ThirdTimerThreadHandle,INFINITE);
       CloseHandle(ThirdTimerThreadHandle);
    
       delete TimerFlag;
    
       //These three could have been done better as an array, but it's just a "simple" example
       //As could the HANDLE variables for each thread
       free(ThirdTimerArgs);
       free(SecondTimerArgs);
       free(TimerArgs);
    
       return 0;
    }

  14. This error pops up:

    "This application has requested the Runtime to terminate it in an unusual way." (Microsoft Visual C++ Runtime Library)

     

    It says that every time any exception is thrown, and where nothing catches it... Knowing what type of exception to catch (and where it is in the code) could be a nightmare to find...

×
×
  • Create New...