Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Sabertrails with mat-based saber!
Sabertrails with mat-based saber!
2004-07-29, 11:03 AM #1
I'm modifying weap_saber.cog to change jkSetSaberInfo(), so that when you swing the saber the width is changed. I got it 'working', except it switches back to the original size way too late! And sometimes it doesn't switch back at all!

would anyone mind checking this out for me?

http://www.angelfire.com/film/mikesteeves/Pro-sabertrail-mat.gob

<CODE>
//Make saber wider for the length of time of the swing's sound.

for (i = 0; i < 256.0; i=i+1)
{
sleep(GetSoundLen(swingkey)/256.0);
jkSetSaberInfo(player, playersbrtip_mat, playersbrside_mat, 0.030, 0.030, 0.125, tpl_wall,

tpl_blood, tpl_saber);
}

// Reset original saber size
jkSetSaberInfo(player, playersbrtip_mat, playersbrside_mat, 0.008, 0.0055, 0.125, tpl_wall,

tpl_blood, tpl_saber);
</CODE>

I put this snippet after the animation and SetFireWait()

I think the concept is relatively simple, I'm just too inexperienced with programming :P

Another method of doing this would be to define an amount of time for the saber to be wide... Not a clue how...

Please help!

-ProAni

[This message has been edited by ProAnimator (edited July 29, 2004).]
2004-07-29, 12:05 PM #2
hmmmm, I'd use SetTimerEx() instead of sleep because sleep is weird. I don't see why you need that for loop either, and I have no idea why you have the /256.0???

I'd do it something like this...
Code:
KillTimerEx(55);
SetTimerEx(GetSoundLen(swingkey), 55, 0, 0);
jkSetSaberInfo(player, playersbrtip_mat, playersbrside_mat, 0.030, 0.030, 0.125, tpl_wall, tpl_blood, tpl_saber);


and also, somewhere under timer:
Code:
timer:
if(GetSenderID() == 55)
{
// Reset original saber size
jkSetSaberInfo(player, playersbrtip_mat, playersbrside_mat, 0.008, 0.0055, 0.125, tpl_wall, tpl_blood, tpl_saber);
}

I'm guessing swingkey is actually a sound since your using GetSoundLen

------------------
I am _ Ace_1 _ , and I approve this message.

[This message has been edited by Ace1 (edited July 29, 2004).]
I am _ Ace_1 _ , and I approve this message.
2004-07-30, 11:22 AM #3
Sweet! I got it working, it's practically seamless! I'm going to also switch to a different mat with a wider white area when it swings, which is just a matter of substituting it in. Eventually it will all be re-matted to look even better! (Once i get the mechanics of the cog working).

---------------
End Phase I
---------------

Phase II of this project would be to get the saber to vibrate/pulse/stagger-glow or whatever you call it. Using the same concept of JKSetSaberInfo() I'd like to have a loop which slighty enlarges and shrinks the width of the saber mat (only when it's not "'fire:'-ing" , or it won't work!)

I've had the suggestion of using a pulse, I'm clueless as to how to code this 'vibration/stagger'.

Can anyone help? Maybe code that up for me? That'd be super! [http://forums.massassi.net/html/biggrin.gif]

If you want the gob file, I'll post it.

-ProAni
2004-07-30, 1:45 PM #4
The vibrating I think would really lag a game over, but it proablay can be done by having it send messages to a local cog or something, but other players wont be able to see it. Instead.. since the saber mat slides up and down the saber's blade, I'd try to edit the saber mat to have varied thickness throughout, so when it slides down the saber's blade, it looks like it's pulsating.

------------------
I am _ Ace_1 _ , and I approve this message.
I am _ Ace_1 _ , and I approve this message.
2004-07-30, 3:16 PM #5
Screenshots? Demo?

------------------
jEDIkIRBY - Putting the Romance back into Necromancer.
Proud Leader of the Minnessassian Council

Live on, Adam.
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-07-30, 4:14 PM #6
Hehe, screenshots wouldn't do it ANY justice, it's just a thicker saber. The whole effect relies on the saber in movement. You'll see it when it 'comes out' [http://forums.massassi.net/html/wink.gif] I don't think I'm going to release it until I get the lightstaff and dual sabers in. Not to mention that the swings for those would have to be entirely reanimated so they're not only functional, but useful, realistic, and interesting, unlike other 'multisaber' mods we've seen to date.

Ace, I've considered using the method you mentioned before. It just slipped my mind, I'll give it a good shot!

-ProAni

[This message has been edited by ProAnimator (edited July 30, 2004).]

↑ Up to the top!