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 → Longshot, but I don't know where to even start...
Longshot, but I don't know where to even start...
2002-12-05, 3:00 PM #1
Alright, here's what I'd like to do:

When the player presses a hotkey, this cog fires a *special template.* Then it check to see if there are any other *special templates* in view, (checks their distance and stuff which I can do) and then after a predefined length of time it either does what I tell it, if their are other *special templates* in view, or destroys itself.

What I'm hopeing to get here is a "saber-locking" effect, ala JO, where the saber checks if another saber is swinging at it while it's swinging itself, but here it's not actually going to be the saber...it'll be my aforementioned *special template,* which might aswell just be a ghost. I'll shoot it out about 0.2 "JK-not-exactly-second-time-units" after the user swings, and it'll check if there's another one close enough and at the right angle (not behind the user) to merit a saber lock.

Right, that's my dream.
But...like I said...where do I start? How would I go about defining something in an MP game (this has to work in MP) as this *special template* and have the cog recognize other *special templates* aswell?

This is probably some fundamental of cog I've missed over the past 2 years, and I'd greatly appreciate some help.

As usual, thanks,
-TIE
2002-12-05, 3:47 PM #2
I'm doing a saber locking technique that uses triggers in the Magician Saber System, but to do that you have to gut the whole JK saber and start afresh.

This will take a lot of cogging get Datamaster, JKSpecs, and Parsec. Keep them handy. To start, to see if the *special template* is in view, use ViewDot() or whatever it is. To use in MP, use the custom projectiles template at Millenium. Saber lock will have to be done with keys, and more codding (imobilize actor flags *hint hint* [http://forums.massassi.net/html/wink.gif] ).

That should be enough to get ya started. If you need more, E-mail me and I'll show you under certain terms and conditions, what I did. [http://forums.massassi.net/html/wink.gif] k, bye. BTW - It ain't easy.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-05, 5:20 PM #3
I've got the Datamaster (invaluable), regularily check in with jkspecs, and have both parsec and scribe, it's just some sort of verb I need that I can't find, something to the tune of IfIsTemplate() or something. As far as I know there is nothing like that, so...what do you think I should use? (And I just KNOW it's going to be something so simple, something I use all the time...but I'm just stumped.)

Because with ViewDot, it's checking for certain flags, not specific templates, so that'd mess it up.

That's the part I don't get. I've got the rest of it worked out, as far as I know...I guess I'll see after this.

Thanks,
-TIE

[edit - ...Hm. What if I used a system to give the user a certain bin when they swing their saber, while at the same time checking if any user right infront of them has that bin aswell? That....sounds easier...wouldn't you say?

[This message has been edited by TIE_14 (edited December 05, 2002).]
2002-12-05, 7:50 PM #4
if(GetThingTemplate(ThingInView) == LockTemplate)

LockTemplate is a template defined in your symbols section. [http://forums.massassi.net/html/smile.gif]
-Hell Raiser
2002-12-07, 3:39 PM #5
Alright.

I've tried both that bin idea I had, and the template one, but neither have worked.

I found out the long, hard, trial-and-error way that you can't check other players' bins in MP. So there goes that idea.
And I have no idea why the template one didn't work, but it didn't. It would lock on, but not do anything. And it was messy and laggy anyway.

So I need something else. What could I use so players can detect if other players are swinging their lightsaber or not? I though of "SendTriggering" some number, but for one thing sending two triggers every time you swing (one to change this number and one to change it back) would be terrible againt the network. For another thing, the number would have to be defined in both the client cog and the saber cog, and that'd be terrible to sync (assuming the only way for one to check the other would be "sendmessage" on either cog.)

I've been racking my brain for...well, only 2 days I guess, but my brain's officially exausted. Any of you guys have any ideas?

-TIE
2002-12-07, 9:49 PM #6
You're gonna love this. [http://forums.massassi.net/html/wink.gif]

Thing flags are synced across the network by JK itself, so any change is instantly updated. (minus lag time, but whats, 100-200ms anyway?)

What good are thing flags gonna do me if they wind up doing something to the thing you ask? Well the answer is simple: just continue where JK left off. [http://forums.massassi.net/html/redface.gif] I've sucessfully used the thing flag of 0x40000000 for my own purposes in MP with no reprocussions what so ever.

So, what you'd want to do is set it at the beginning of the swing, and clear it at the end of the swing, and everything will be dandy and randy from there. (so long as this is all the help you need. [http://forums.massassi.net/html/wink.gif] )

Happy coding!
-Hell Raiser
2002-12-08, 12:59 AM #7
That's very interesting, HR. It seems that the flags are stored in longints...that would allow a highest flag of...**** , the calculator can only handle 16bit hex numbers...what a pity.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-12-08, 8:16 PM #8
It's perfect, exactly what needed. I went ahead and used 0x80000000 aswell, and I've noticed no problems, slowdown, nothing. After tweaking the code all weekend, I've got near-flawless saber locks.

But...now what? I've got them to lock fine and all, but as of now I've just set either..eh..."lockee" to disengage with a slight kickback force after 5 "jk time units." With the bin idea, I was planning on doing a "bin = bin+1" thing for the fire code while locked, and then after the 5 seconds, compare the two and decide who gets damage and kicked back, but that fell through with the rest of thje bin idea, so I haven't been able to make it an actual competition.

This, in MY opinion at least, is just a bit trivial. I'm happy with just the 5 second lock, then having it always end "as a tie." But if I could figure out a way to make the locks matter...well, then I might aswell.

Once again, and much to the chigrin of my problem-solving nature, I plea for ideas.

Thanks,
-TIE

[This message has been edited by TIE_14 (edited December 08, 2002).]

↑ Up to the top!