Posted By: Krammit
Aquiring/Equipting Items - 07/16/06 03:39
Ok. So a small project im working on, is getting to the stage where advanced scripting is almost needed. I've worked out all the kinks in the main engine, so the basics are done (with the exception of enemies, enemy intelligence, etc)
There are some things I've never programmed before, and that is being able to aquire an object, and then have it equippted as a weapon.
What I have is this:
You play as a knight, but when you start, I wanted it to not have weapons. Instead have to search the map, to get them.
Basically have it so;
If you come in contact with the weapon (the sword) it becomes equippted to your hand, then follows the hand during animations (moving, attacking, jumping, etc)
Same as the shield, upon collision, attack itself to the left arm (not the hand)
I'm wondering if theres a script capable of that? Or an example/tutorial available somewhere. (I'm guessing it would involve rotating the shield, so it hangs lenght wise on the arm not holding the sword)
If it helps, all my scripts are included to the game with the
Code:
So help is definitly appriciated, seeing as it helps the overall development.
And if it isnt too much trouble, my music wont play. I've worked out a script I thought would play midi files, but notihng plays during the game, but the script appears to load file, heres the script:
Code:
But it doesnt seem to actually start any music.. So, am I doing something wrong? o_O
Thanks.
There are some things I've never programmed before, and that is being able to aquire an object, and then have it equippted as a weapon.
What I have is this:
You play as a knight, but when you start, I wanted it to not have weapons. Instead have to search the map, to get them.
Basically have it so;
If you come in contact with the weapon (the sword) it becomes equippted to your hand, then follows the hand during animations (moving, attacking, jumping, etc)
Same as the shield, upon collision, attack itself to the left arm (not the hand)
I'm wondering if theres a script capable of that? Or an example/tutorial available somewhere. (I'm guessing it would involve rotating the shield, so it hangs lenght wise on the arm not holding the sword)
If it helps, all my scripts are included to the game with the
Code:
include <nameoffile.wdl>;
So help is definitly appriciated, seeing as it helps the overall development.
And if it isnt too much trouble, my music wont play. I've worked out a script I thought would play midi files, but notihng plays during the game, but the script appears to load file, heres the script:
Code:
var LoopMusic = 0;
// Plays the given MIDI file
function DMusicPlay(SA2Death.mid)
{
LoopMusic = 0;
PlayDMusic(SA2Death.mid);
}
But it doesnt seem to actually start any music.. So, am I doing something wrong? o_O
Thanks.