PDA

View Full Version : Grapple Hook


ASk
06-08-2002, 04:42 PM
I managed to make stun baton alt-fire act as a grapple in quake
Thx to Cobra and Vesentac for their support (this one was not based on your code tho :) )
i now fix the last bugs: grapple not being able to release - found the source, fixing
unknown even on death - hopefully fixed
trail drawing - hopefully fixed

Tchouky
06-08-2002, 04:54 PM
that s good news !

will you release the source too ?
that 'd be great !

ASk
06-08-2002, 05:13 PM
well, cobra helped me on this one a bit, so if he wants to, i will be glad to release the source
i get now unknown trType error on client death
and also unknown events and it wont add me to player list as well as auto spawn at the map start

ASk
06-08-2002, 05:28 PM
UPDATE:
Grapple grapples onto wall and releases
I still get the bugs:
- unknown trType on player death
- unknown Event sometimes
- Player does not show in list
- Player does not autospawn

ASk
06-08-2002, 07:18 PM
welll
vesentac, cobra..i uploaded the code to
http://www.darklordofsith.net/ask/grapplecode.zip
all mod addings are labeled by
=====grapplemod======
try to see what is the cause of the constant errors, because i have no idea.

striderx2048
06-08-2002, 10:09 PM
i hope you add an option for offhand grapple

Vesentac
06-08-2002, 10:23 PM
Ok ask, I got the source from Normal..

Your additions in the client code confirmed my suspicions. I commented out all the WD_emplaced_gun code but it didnt work. That's when I suspected missing something in the client code.

Cobra and I were trying to aim for a server side only release but he did not finalize the cgame source.. when Cobra is back, I'll try and guide him through the process.

DiscoFever
06-08-2002, 11:43 PM
EXCELLENT!

I can't wait to try this out!

DarthCobra
06-09-2002, 03:07 AM
Should have just added this to other tread ;)


I got the source i guess.. about to look at it .. lemme know how its going ....

ASk
06-09-2002, 03:16 AM
i didnt find your thread *shrug*
something is definitely missing.....adding the bots crashes the game as well, i just dont know what could cause it, the only things that were added are the missile hadling of grapple and the firing code for server side and a grapple release code for client side (also there are some effect drawing functions, but commenting them does not fix anything)

ASk
06-09-2002, 04:08 AM
the problem was the added variable in playerstate_t struct (defined in q_shared.h, and better not to be changed)
so now i am thinking of how to transmit the data to client, as it uses pmove_t struct for movement and this does not help - no reference to using entity

Vesentac
06-09-2002, 06:00 AM
ASk,

god damn it.. has to be a way...

EDIT========================================

I need to go to sleep.. but perhaps this (http://www.planetquake.com/code3arena/tutorials/tutorial27.shtml) can give us some insight. It's the premise that interests me. But we need to stick a vect3 in the PS.. not grab existing data and modify it another place the code.....

I'm gonna have to hunt down some Raven Personnel

DarthCobra
06-09-2002, 07:19 AM
Well i just compiled, and its seems to work until it crashes..

S_RegisterSound: empty name

Im sure that cant be that big a deal but im sure theres more too it.. Was fun to grapple around a little though.

ASk
06-09-2002, 07:35 AM
for the s_registersound try seeing weaponinit.c
but the main bugs are crawling all over the place

Vesentac
06-09-2002, 07:37 AM
Well we could shoot down the hook as a "weapon".

Why not go for the Offhand grapple hook (http://quakestyle.telefragged.com/quake3/tutorial5.htm) ?

But we still need that damn vect!!!

ASk
06-09-2002, 07:42 AM
well, as you can see:

Since no modifications to playerstate have actually resulted in a stable game

(From Code3Arena)

I am out of ideas, and i doubt that the method they use for reloading will work in this case...

Vesentac
06-09-2002, 08:02 AM
Ok ok ok... I've been racking my brain on this..


In JK2, lastHitLoc = to our grapple vect in q3

So maybe if we can manipulate how lastHitLoc works.. we can use those coords to where we want the hook to be.

i did a search, only 6 occurances of lastHitLoc.

All were VectorCopies, 3 of which copied lastHitLoc to origin2. the other 2 dealt specifically with the disruptor disintigration. Last occurence is the definition.


EDIT=============================
Ok 1st Vector Copy is for
BG_PlayerStateToEntityState

This is done after each set of usercmd_t on the server,
and after local prediction on the client

2nd Vector Copy is for
BG_PlayerStateToEntityStateExtraPolate

This is done after each set of usercmd_t on the server,
and after local prediction on the client.

3rd Vectorcopy is for
CopyToBodyQue

A player is respawning, so make an entity that looks
just like the existing corpse to leave behind.

Other 2 are disintegration effects like it matters.

Last is definition.

Good Luck Ask. and if it works.. get the offhand Hook code going because I am burnt. If this doesnt work, I really am going to look for Raven programmers.

ASk
06-09-2002, 08:11 AM
from what i see, lasthitloc is used to determine the last location
that the player was hit in, not the last location of any hit...
however, it's used only in 3 places in code, one of which is called only when you fire the disruptor (to make the disintegrating effect from the hit location)
so, we might be able to use it "temporarily"


EDIT:

oh bah...didnt see you writed the same thing :P
i compile the code now....lets hope it works

ASk
06-09-2002, 08:26 AM
it worked!!!!!!!
however i do use a very crude method (not backing it up or something). i figure out that if something hits the player mid-flight. he will stop in his place....think of it as another tactic


now we need a model for the grapple itself...i'm sure that soemone with good modelling skills or with Quake can supply us with it :P

thx a lot to Vesentac and Cobra as well

Vesentac
06-09-2002, 08:30 AM
Great!!!:cool: :cool:

Now I go to bed for the remaining last 3 hrs of sleep I have..


Get that offhand code going!!:) :) :) :) :)



Who's your daddy!!???

J/k
:D :D

ASk
06-09-2002, 09:53 AM
the offhand grapple is done (at least the grappling effect, no model for grapple/rope yet as i dont have quake where i could take these models from)

the grapple firing button is USE (not the USE ITEM, but USE, defaults to 'E')
from what i understood here's the process of firing grapple:

- press USE till the grapple attaches
- while holding use, grapple pulls
- on release, you stop being pulled
- tap USE to remove the grapple from it's point
- Now you can repeat the whole process once again

Consider this a beta, as some used variables may break the game some day (or they already do, but we are not noticing :P)

in about 5 minutes i will upload the pk3 file.
the source will be uploaded later in the day

Tchouky
06-09-2002, 10:18 AM
sweet !!

btw i own quake 3 and i ll look for the grapling hook models ,sounds and textures if you want me to !

ASk
06-09-2002, 10:37 AM
http://www.darklordofsith.net/ask/grapple.zip

the source i will upload in about 5-6 hours, the above file is the pk3+readme

enjoy :P

Tchouky
06-09-2002, 12:44 PM
it s awesome !!

it really works great !

good job !

Vesentac
06-09-2002, 01:19 PM
Originally posted by ASk
the offhand grapple is done (at least the grappling effect, no model for grapple/rope yet as i dont have quake where i could take these models from)



This can easily be solved based upon the CGtrail and a current shader.


the grapple firing button is USE (not the USE ITEM, but USE, defaults to 'E')
from what i understood here's the process of firing grapple:

- press USE till the grapple attaches
- while holding use, grapple pulls
- on release, you stop being pulled
- tap USE to remove the grapple from it's point
- Now you can repeat the whole process once again

[/B]
"tap USE to remove the grapple from it's point" this doesnt sound right, you probably need to chek HookFree().


I'll hook up with the code later

ASk
06-09-2002, 02:21 PM
the actual code has to be done like this, because the USE button does not trigger the EF_FIRING flag or any other flag, thus we have no means of passively tracking it like with Attack button case
So either we define a new flag or something or we leave it that way.

Also, it seems to screw up in heavy battle conditions, probably the lastHitLoc coming into effect

EDIT:

well, i was wrong here :P
i fixed the code and now when you release the USE button, you automatically stop being grappled :)
and nothing screws up too :P
in about 15 minutes they will be uploaded to:

mod:
http://www.darklordofsith.net/ask/Grapple.zip

source:
http://www.darklordofsith.net/ask/Grapplecode.zip

if the links seem to be broken, try the G in lower case, as the server is case sensitive.

Fun grappling

ASk
06-09-2002, 04:00 PM
bump!

Tchouky
06-09-2002, 04:19 PM
i m testing it ...

and do you need the q3 model of the grapple hook ?

if yes i ll send it to you ....

ASk
06-09-2002, 04:43 PM
well, i dont intend to use the grapple hook model for the "weapon" view...the actual hook is the same model as used in q3, at least the same one as defined in q3 code

Vesentac
06-10-2002, 01:24 AM
As Ask has been meaning to fine tune his code , normal made a good suggestion on IRC. Now if he wasnt a lazy bum, he'd post it now.

BTW Bump, sticky pls. Real mod here !

normal
06-10-2002, 01:54 AM
Now Vesentec is lazy :P

My suggestion was to make it a command +hook, ala good ol' Quake 1.

Darkhold X
06-10-2002, 03:17 AM
Hmm pretty neat to mess with. I have always geard about these things in quake, but never have used em.

and were did you find that avatar pick normal?...

ASk
06-10-2002, 03:23 AM
in any case, the enum that defines the possible custom commands is in q_shared.h (genCmds_t), so i'm scared to edit it :P

DarthCobra
06-10-2002, 09:27 AM
Well I think this is getting somewhere finally. Ask has redone the code yet again for an onhand grapple. I intend to replace the bryar pistol with an ascension gun. The grapple will be the alt attack and the primary attack will be switched to the alt bryar attack. The main problem now is the missiletrail. I tried using the one from purectf but it seems the RT_LIGHTNING is commented out in the jk2 source for some reason. Not sure if i wanna turn it back on. Then I started thinking about using a *.efx file. But I of course cant figure that out at all. If somone might know of a way to do a rope/cable *.efx I would appreciate any input. The current missiletrail is using RT_BEAM and well .. it just give a read beam instead of the rope it is spose to be showing.

normal
06-10-2002, 11:48 AM
Originally posted by Darkhold X
and were did you find that avatar pick normal?...
I created it from a game called "Metal Slug X" (It owns btw..)

ASk
06-10-2002, 12:21 PM
my released grapple will still be offhand :)
In my opinion it's better to be able to use it in addition to firing your weapon (think of an escape route)

you may do with the onhand grapple anything you want ;)

Darkhold X
06-10-2002, 12:41 PM
I think a beam would be pretty cool behind it. Its kinda odd right now without anything really there to pull you :D.





Originally posted by normal

I created it from a game called "Metal Slug X" (It owns btw..) Oh, just looked a bit familiar;) http://msprites.iongames.org/browse.php3?cat=31

normal
06-10-2002, 02:12 PM
Hey cool site!

Ok, I lied. :jawa . Reason I said I made it, was because I did make one, but it wasn't as good as yours.. :( so I used yours.

DarthCobra
06-10-2002, 02:38 PM
Well its not that i dont think an offhand grapple is better. Im just tryin to go with the ascension gun. Which wouldnt really be offhand.

yodaissmart
06-10-2002, 05:12 PM
heck yes! this rulez. thanks i wish i saw it earlier then i'd have tried to help you guys develop it... oh well kick @55 mod.

Perra27
06-11-2002, 05:23 AM
cant you use the lightsaber throw animation when you throw the hook??

if you use that you dont need to make a new animation.

and put a rope or somthing behind it so you see were you are going.
othervise great job! :atat: :bdroid1: :band: :fett:

ASk
06-11-2002, 07:33 AM
DarthCobra is trying to create a rope effect now.
As for the animations, I'm not really good on that subject. Never looked into it much

Darkhold X
06-11-2002, 12:15 PM
I kinda like the fact you can still be swinging the whole time.:D

yodaissmart
06-11-2002, 06:02 PM
Using this mod is fun. I plan on putting it on my server which is up every now and then normally weekends. Also I was planning on skining my own Mandalorian skin... i would like to know if i could include this with it (i will give you credit of course). thanks

JediGhost[SITH]
06-12-2002, 07:15 PM
Hmm, is it me, or is there some changes in the saber attacks.. When the backstab (or backswing) is performed, you can't turn..

ASk
06-13-2002, 03:48 AM
apparently you read in a selective way....the explanation is all over the boards:

the source is not 1.03, rather it's 1.03a
some changes include the backstab, inability to do a blue-style lunge in the air and some damage changes.

and don't request from me to go and fix them, because i won't...IMO these changes were needed

JediGhost[SITH]
06-13-2002, 01:35 PM
Yes, they are needed... But this mod is for a grapple hook, not a saber mod..

Good job on it though, I was convinced that it wasn't possible.

Lord Nodata
06-14-2002, 12:15 PM
ASK: You posted the source code to your grapple hook, but to search thru that and find all the changes you made would take FOREVER. Is it possible for you to just post the changes you made to the code instead?:)

ASk
06-14-2002, 12:31 PM
all changes are marked by "grapplemod" tag (at least 99% of them are)
there's a fairly large number of changes...so i'm sorry, i won't post them here

Lord Nodata
06-14-2002, 01:57 PM
ASK: I got your mod downloaded, so how do i get it running on the server? I tried putting it in the gamedata folder, but it doesn't show up in "Mods" then...and I tried putting it in the base folder but not working there either...a command line is needed? or what?

Thanks in advance!!:D

JediGhost[SITH]
06-14-2002, 05:24 PM
I put the PK3 in the GameData\Base folder (make sure it's there), and then ran the game..

When you get in the game, type this:

bind <KEY> +use

For example: bind q +use

then just hit that button and voi la, a flying tack that can pull you anywhere!

ASk
06-14-2002, 06:17 PM
that was not a wise thing to do...its not designed to run as a "mod" that you put in base.
the correct procedure would be making a dir inside gamedata and placing the pk3 there
then in game going to setup->mods and choose it there


JediGhost, what you did probably would cause you to being unable to join servers, and if you were able to join one, you would have bugs

Lord Nodata
06-14-2002, 06:41 PM
Yeah i put it in it's own folder called "grapple" in the Gamedata folder, and just loaded it as a mod. It worked GREAT!

Lord Nodata
06-14-2002, 06:49 PM
ASK: It was mentioned before that this Grappling hook was going to be applied to the Jedi vs Merc Gamemode as a MERC ONLY item. As it is now, it applies to both Jedi AND Mercs...could you change that?

JediGhost[SITH]
06-14-2002, 08:40 PM
First off, I can't join servers anyway! (Except my own), I have a Linksys router forwarding to my OTHER computer. So all ports 28070 thru 28090 are sent to that machine.

In other words: I can't even get a games list, or join other servers, except those on my network here at my house.

I don't see why putting it in the Base folder would case any problems.. Except for hosters that wanted to get rid of the MOD, but just not by deleting it..

If I joined another server that didn't have the mod, everything would be normal.. Just as if I had a skin on my PC that the server did not.

But I can't be sure, it may not have even let me join the server...

EDIT:
Oh yeah, also, the computer I'm hosting my server off of can't even run JK2! I have to host the server from a DOS-window.. 1.03A to be exact.

ASk
06-15-2002, 02:33 AM
well, the mod is a modified game code..not some addon.
it's like having 1.02 trying to join 1.03.....
you are lucky my mod changes something which not affects gameplay that much

ASk
06-15-2002, 03:20 AM
well...i completed the grapplemod change, which is the Jedi VS Merc spawning rules. Only Mercs will spawn with grapple.

I would upload it, but my site seems to be currently down.
In a few hours though it would be at

http://www.darklordofsith.net/ask/Grapple.zip

After you download it, check if it's the v1.0 mod, if not, that means I haven't uploaded it yet

Lord Nodata
06-17-2002, 11:01 PM
Did you also update your "Grapplesource.zip" to include the new changes to Jedi vs Merc?:confused:

ASk
06-18-2002, 02:05 AM
no, not really...lazy to upload
all i did is adding a check if it's a jedivmerc game and if it is, whether the player is a merc in the g_active.c, in the grapplemod part

striderx2048
06-18-2002, 03:33 AM
this might not fit with the mod
how about grabbing items with the grapple
all but flag

Toonces
06-18-2002, 05:41 AM
Put the grapple up on my server earlier today, It's TOO much fun to use :D

The grapple is definatly great idea for Jedi/Merc, I just got done with a game. There are a few problems with the hook. Mercs seem to be able to move much better than Jedi's can, that's only a minor point. The larger problem is that on some maps, Mercs can get on the ceiling, out of reach of any Jedi (even with max saber throw) and snipe or lob stuff on everyone.

What Mercs really need is a few new traps to play with. The grapple is definatly a great start though

CT :lightning

Lord Nodata
06-18-2002, 09:18 AM
ASK: Is there a way that you could code the grappling hook to only stay latched for about 10 seconds? Then release and not be able to be fired for another 5 seconds?:confused:

striderx2048
06-19-2002, 03:57 AM
Originally posted by Lord Nodata
ASK: Is there a way that you could code the grappling hook to only stay latched for about 10 seconds? Then release and not be able to be fired for another 5 seconds?:confused:

how about server side variable for the admin to detemine the hang time and cool down time?

Lord Nodata
06-19-2002, 04:20 AM
Originally posted by striderx2048


how about server side variable for the admin to detemine the hang time and cool down time?

Thats an even better idea...good one! :D

ASk
06-19-2002, 04:28 AM
well
not now...i leave the scene for a couple of weeks....NWN is here


must...go...play...NWN

Galactic Magi
06-20-2002, 01:32 PM
how could they break the game with the variables? (thats what it said in the description)

ASk
06-21-2002, 04:10 AM
Um...i needed a variable and i coudn't add one to playerstate_t struct...so i reused one variable which is not commonly used (used twice in disntegration effects and once in prediction)

so far it did not break the code

Lord Nodata
07-17-2002, 04:15 AM
ASK: Can you update your grapple mod to be compatible with the 1.04 patch? Also PLEASE PLEASE update the source for it when you do that. Thanks!

Zey
07-17-2002, 06:42 PM
Well Wicked Nice 1 mate.

I haven't tried it yet, but u could try and make it look like Luke's Grapple Hook in Ep4......

In my Opinion it should be from the hand too :)

Zey
07-17-2002, 09:41 PM
For Jedi's you could have a mini light saber.....

Could try and scale down the existing one and make it do the saber throw animation?

Another feature you could do is make the hook do damage?


For Merc's just copy Jango Fett's in Ep.2 and if it hits people, you can pull them about....

There's my 2 pence worth :)

Wicked MOD.. nice one.

leviatho
07-18-2002, 12:06 AM
any chance someone can confirm to me if the current grapple mod restricts one sire to mercs and one to jedi? i can't seem to get it to do it? as the source is out anyone care to modify it to do so if nice mr ask is indesposed playing NWN :) That is the only feature that i feel is really needed. if it is in there already, can someone tell me what i have to do to enable it?

ASk
07-18-2002, 03:05 AM
um
no need to bash me

i will answer the questions:

a) the current mod has the JediVMerc code in (http://www.darklordsofsith.com/ask/Grapplemod.zip (or was it Grapple.zip))

b) the source...all that was changed was a new if(!) surrounding the USE code in g_active.c I do not think that this easy change is worth for me to spend time to upload the code (56k, bare with it)

c) the 1.04...i haven't tested it. And i do not have details on needed changes too. If someone directs me to the relevant source, I will update the mod ( And then I will upload the source)

d) No new features are in planning. This mod was originally meant to show people that it is possible to take the grapple hook from q3 and insert it into jk2. Mad props to DarthCobra and Vesentac for making me to do it :)

e) As I do not play JK2 much, I doubt that I will ever add the flashy features. Bear with it...or feel free to change the code. Many people here are capable of doing so. A lot of them do this better than me.

f) It seems that I will be out of JK2 coding scene. I have new projects in development (a Bulleting Board software comes to mind). I will start shortly on my school required project. So there :)

Sorry if I disappointed you. Life must go on.

Zey
07-18-2002, 10:20 PM
Alright Ask, well done on the grapple hook mate. it really is good.

I was wondering if i can use it on the MOD i'm doin?

http://forums.barrysworld.com/showthread.php?s=&postid=338558#post338558


tahnks

Zey

ASk
07-19-2002, 01:40 AM
As I already said: Feel free to use this code in your mods. Just state my name and you can send me an email or something :)

No need to ask permission.

Zey
07-19-2002, 02:48 PM
:D nice one :)

Go to the link, ur name is already entered ;)