Wanna shoot gun by pressing key

Started by Tha2ohSIX, Mon 21/04/2003 12:42:51

Previous topic - Next topic

Tha2ohSIX

Hey... in my game I've got it where when you click the gun in the inventory on another character it runs an animation of the main character shooting.  How do i make it so you can equip the gun and have it say a message like "the gun is equiped". then you would be able to press a single key, like control or spacebar to shoot the gun?

Question 2: I have animations of the other characters dieing for when they get shot, but i dont know how to run them like halfway through the shooting animation. Can anyone please help me out?

Scorpiorus

#1
QuoteHey... in my game I've got it where when you click the gun in the inventory on another character it runs an animation of the main character shooting. How do i make it so you can equip the gun and have it say a message like "the gun is equiped". then you would be able to press a single key, like control or spacebar to shoot the gun?
It depends on how you want to organize it. Do you have a custom inventory GUI? Can you provide a bit more information on how you suppose to equipe it? You can choose bullets inv item and click it on gun for example or ...?

QuoteQuestion 2: I have animations of the other characters dieing for when they get shot, but i dont know how to run them like halfway through the shooting animation. Can anyone please help me out?
You can try this:

AnimateCharacter(KILLER, ......);
while (character[KILLER].frame < 7) Wait(1);
AnimateCharacterEx(VICTIM, ......, blocking=1);


The script starts the second animation just after KILLER's frame is 7.

-Cheers

Tha2ohSIX

hey thanks for all the help.  I just tried the script below and it freezes the program right when i try to use the gun on the NPC.

 // script for character1: Use inventory on character

SetCharacterView (EGO,3);
SetCharacterView (JACKO,6);
AnimateCharacter (EGO,0,5,0);
while (character[EGO].frame < 4) {
AnimateCharacterEx (JACKO,0,5,0,0,0);
}
ReleaseCharacterView (EGO);


Also I don't really know what i'm gonna do for the inventory.  I want a stats gui that you can click on, then it brings up a stat screen where you can load ammo and equip the guns.

Gilbert

I'm not quite sure, but try this:

SetCharacterView (EGO,3);
SetCharacterView (JACKO,6);
AnimateCharacter (EGO,5,0,0);
while (character[EGO].frame < 4) Wait(1);
AnimateCharacterEX (JACKO,5,0,0,0,1);
ReleaseCharacterView (EGO);



BTW are you sure you put the loop number, etc in right order?

Scorpiorus

QuoteSetCharacterView (EGO,3);
SetCharacterView (JACKO,6);
AnimateCharacter (EGO,5,0,0);
while (character[EGO].frame < 4) Wait(1);
AnimateCharacterEX (JACKO,5,0,0,0,1);
ReleaseCharacterView (EGO);
Yep, you need Wait(1), as Gilbert pointed out.


QuoteAlso I don't really know what i'm gonna do for the inventory. I want a stats gui that you can click on, then it brings up a stat screen where you can load ammo and equip the guns.
Do you have something done already? You can use GUI buttons to reload the gun etc. Actually I don't fully understand about the exact view/style of that GUI.

-Cheers

SMF spam blocked by CleanTalk