Tuesday, 30 November 2010

Project changes and helpful vehicles

Weeks 7 and 8 were given over to pretty much searching the LSL marketplace for a suitable vehicle to use for the project, some success in getting the vehicle for the flight simulator, someone has made a firefly and on the market place its entirely free - result!


Isnt she beautiful, hopefully this lovely craft will help me create a okayish flight sim with some good vehicle code and some randomly moving targets should be fun.

Monday, 22 November 2010

Heads up!!! Its HUDs!

HUDs are extremely useful and i was amazed at how simple it was to create custome HUD's the idea of just creating prim and put an image of what you want onto it, the idea is so simple its almost beautiful and probably the best thing second life does.






The above picture shows the prim with the fire text atachted to the HUD the prim acts like a button which fires my weird flying saucer as a bullet.

Project - On the search for a vehicle to use in the flight sim, still think that the off rails rollercoaster might be the better option.

Sunday, 14 November 2010

Project Design and List taking

Well week 5 and we are ... making lists, lists everyone needs lists and it can be suprising what you can do with a good list. For the example exercise we were tasked to create a prim which would record the number of objects and avatars which have bumped into it. Shown below is the code for this prim making the lists:

list mylist = [];

default
{

state_entry()
{
// llSay(0, "Hello, Avatar!");

}

collision_start(integer total_number)
{

llOwnerSay(llDetectedName(0) +"::"+ (string)llVecMag(llDetectedVel(0)));
string name = llDetectedName(0);
float vel = llVecMag(llDetectedVel(0));
mylist = [name, vel] + mylist;

}

touch_start(integer total_number)
{
llOwnerSay((string) mylist);
}
}

Project Design - now a little bit serious, my project has a few ideas in fruition it will be either a flight sim or an off rails rollercoaster. Using the impulse and gravity commands to navigate them, should be lots of fun to create and play about with.

Monday, 8 November 2010

guns, flying saucers and other miscelaneous terror!

Seriously falling behind here, useless at blogging heres weeks 3 and 4.

Week 3 Ressing objects - this was alot of fun and relatively simple to do once i got the hang of the gun mechanics, the barn door was pretty simple and the code is pretty straight forward:

default
{
    state_entry()
    {
       // llSay(0, "Hello, Avatar!");
    }

    collision_start(integer total_number)
    {
        llOwnerSay(llDetectedName(0) +"::"+ (string)llVecMag(llDetectedVel(0)));
        llOwnerSay(llKey2Name(llDetectedOwner(0)));
        //llOwnerSay(llDetectedName(0) +"::"+ (string)(llDetectedVel(0)));
    }
}

 Week 4 was much more interesting and dealt with the movement of objects i enjoyed this lecture alot and played about with the physics of gravity in second life to create a flying saucer and creating some simple movement commands to send the ufo flying away from me for a few seconds, stop then fly back. Here is the code:
default
{
  
    touch_start(integer total_number)
    {
        llOwnerSay("Touched. Starting Flight");
           float mass = llGetMass(); // mass of this object
           float gravity = 9.8; // gravity constant
        llSetForce(mass * <0,0,gravity>, FALSE); // in global orientation;
       
        llApplyImpulse(llGetMass()*<0,5,0>,FALSE);
        state time;
      
    }
   
   
}
    
state time
    {
    state_entry()
        {
            llSetTimerEvent(5);
        }
   
     timer()
        {  
            llApplyImpulse(llGetMass()*<0,-10,0>,FALSE);
            state time2;
        }  
               
    }
   
state time2
    {
    state_entry()
        {
            llSetTimerEvent(5);
        }
     timer()
        {
            llApplyImpulse(-llGetMass()*llGetVel(),FALSE);
            state default;
        }
    } 

By using impulse i get a steady movement which can sometimes go a little crazy when it hits something but here are some images of the heart of gold (brown taurus!) in action:







Pictures of a moving object dont work very well but its there and it works wonderfully :D

Project
For the amusement park im going to use the movement physics to to create a simple flight sim which will enable the players avatar to get into an aircraft and fly through a series of moving targets in a specific time limit. The user will gain points for each target they fly through and this will be posted with the times of other players in notecard form. The vehicle will use the inbuilt vehicle commands and the targets will use timed impulse movements such as the one used in the above flying saucer.