Tuesday, 13 December 2011

Mini-game update!

I have decided to change the mini-game slightly:

Firstly it will now be a timed game, the player has 30 seconds to shoot as many targets as they can. This proved a more viable game to make using everything we have covered in the weeks tasks and not trying to over complicate the first real game I have programmed.

Week 7 - Chat and e-mail!

This weeks tasks were all about chat and email. Its quite strange to have objects that can email other objects or avatars and then even RL email accounts. But it does seem like a smart feature to LSL.


First task was to create an object so that when touched would run a sensor for avatars in a 96m range(being max). Then another script that would send an email to an address with the information we had asked for.


I got the script to scan the area for avatars working just fine, but for the rest I really had no Idea how to do it. After spending a while researching why my code wouldnt work I gave up. I will come back to this at a later day. Here is what I have for now:




But it doesnt seem to do what I want it to.



Week 6 - HUDs (Head up displays)

I have really been looking forward to this part of the module, as I have quite a passion for game development and this is one of the focus points in which I want to excel. I found the scripting on this part relatively easy for once clicked will shout a word over a obscure channel and be listened by another script on another prim and then depending on the word shouted, changed the position of the prim.


Once I got that working, my next task was to once clicked to attach to avatar, then to be able to use it as a very basic UI. The llAttachToAvatar function is quite annoying to use but is needed for this bit of my mini-game so here it is:


The scripting was actually less of a challenge than getting the textures to display properly, but there you go. Two working buttons that control the height of that ball you see floating. I am proud and quite enjoy working with llShout and llListen to cross-communicate objects. Nice system they have.

Monday, 12 December 2011

Week 5 - Datalists and notecards

For this weeks tasks, we looked at lists and notecards. In LSL there is no arrays, so list takes over... But not all the functions are the same.


The first task was to create a script that once a collision was detected, to store the avatar name, avatar KEY and speed at which the avatar/object collided with the prim containing the script. 


The second task was to display this data to the owner of the script on touch of the object. So I thought I would save some time and just put them together. When I tried this task, it wasnt that difficult at first but then I couldnt get the list organised well using the code I had got. Here it is and the output:



Output


I then researched some stuff about list organisation and ease of reading in second life. And re-coded the list and here is the final out: 




From this exercise so far, it has shown me some of the magical powers of loops and lists. These are a powerful tool when used together. 


I had a good bash at the third task but couldnt get it all working. I did manage to get the script to read from the notecard but then not really do much else after that. 





Wednesday, 7 December 2011

My mini-game idea so far!

Right, the concept of my game is:

There are 2 cannons, that 1 player will control each cannon. Once clicked on the cannon, both players will have to select start game, then the HUD will show up.

On the HUD there will be 5 buttons, rotate the cannon left or right, raise it up or down and fire.

The players will have to aim the cannons at a target and fire. If the player hits the target, their score will raise by 1. Once a player destroys the target, they will move to a different location to be aimed at once more and shot at. Rinse and repeat until game is done. At this point, I'm not too sure on what the points should go up to.

Once the game has ended, a scoreboard will appear with both players names, score, hit%(maybe) and whether they want to rematch or leave the game.

Monday, 5 December 2011

Week 4 - Moving and Rotating objects.

This weeks tasks were to move an object around using scripting. The first thing I did was make a prim and make it move along up the Z-Axis 2 meters. This was for a non-physical object.


After I got the basics down, I decided to go for a script that would move a physical object. I used a different script on this one, I found a what seems like easier set of instructions but not as efficient no doubt.


What this does is stores the position of the starting and end positions of the prim in vectors, then a while loop will keep looping over, if the vector distance is more than 0.001 between the 2 locations, it will move this object towards it.

The last bit for this weeks tasks was to set up a rotation script. I really do not have a clue how the script works at the moment, but will have to come back to it.

Thursday, 1 December 2011

Week 3 - Rezzing objects!

For this weeks task, we had to wing it and to cover rezzing objects by doing the research and applying different techniques. This turned out to be very good programming practise for me. Anyway, on to the task!

Firstly, I created a prim that once touched, rezzed another prim just above it. After a few clicks I realised these blocks just stay there... 


So, I went researching for a way to make them de-rez after a little while. Sure enough I found it, the llDie function. I then added a script to the bullet to make it delete itself after a certain amount of time. I will need this. This can be changed at a later date to fulfill my assignment needs.

Then I raised the velocity and the direction so that once clicked it shot a projectile.


For my assignment, I would like a cannon that once touched, fires.
This will mean that I need to find a way how to make the bullet fire from the end of the cannon, whichever way it is facing. So that will be interesting.