Weapon tutorial - HappyHouR - 10-15-2009
I never really saw a dc weapon tut that gives info about weapons.Well at least not a full one.I tried&still trying to create one.
Weapon tutorial:
Weapons: Weapons are objects that unlike t5/t3 react to the gravity.They also react to ik11/10 antigravity itrs &freeze whirlwind itrs ik16/15.
Frames 0-15(in t2 its 0-5) are in_the_sky frames where the weapon spawned by the background if the is id between 100-199.
Code: id: 100~199 drop weapon
Type: 1,2,4,6
Are weapons.Type 4/6 bounce when they hit ground cause its defined in the exe.
The ai(computer player) try to pickup weapons with id 100-199/213 & state: 1004/2004.
Note: Weapons on ground are in frame 64/20 with state 1004/2004.From there the unmodified weapons are being picked up & those states are enabling it.
Note: All weapons react to direction +attack as throw command except t2 that respond directly to attack .After you press attack in t2 its read the direction input & aim .You can't face > with a t2 and throw < the other way.If you try this it will just make you to turn around .
Note: If a weapon being hit by itr with bdef 100 its will be destroy .The injury value won't matter.
Code: id: 100 type: 1 file: data\weapon0.dat #stick
id: 101 type: 1 file: data\weapon2.dat #hoe
id: 120 type: 1 file: data\weapon4.dat #knife
id: 121 type: 4 file: data\weapon5.dat #baseball
id: 122 type: 6 file: data\weapon6.dat #milk
id: 150 type: 2 file: data\weapon1.dat #stone
id: 151 type: 2 file: data\weapon3.dat #wooden_box
id: 123 type: 6 file: data\weapon8.dat #beer
id: 124 type: 1 file: data\weapon9.dat #<
id: 217 type: 2 file: data\weapon10.dat #louis_armour
id: 218 type: 2 file: data\weapon11.dat #louis_armour
I must note that weapons with the original ids has connection with the broken weapons data.If you create a weapon with id 175 lets say & its get destroy then its won't show the broken pieces of the weapon. Its only apply to original ids(as far as I know that is but I may be wrong) .
States:
State 1000 - in_the_sky
State 1001 - on_hand
State 1002 - throwing
Its responsible for movement speed of the thrown weapon& if you change the state in frames 40-55 in weapons it cause
the thrown weapon to fly in unrealistic manner .
State 1003 - on ground state(unpickable).
State 1004 - Alllow to pickup weapons/change teams.After you picked up the weapon the game count the damage the weapon does as your damage the same way its does with balls you spawn cause the weapons is in your team.
Also ik2/7 interact with this state.
State 2000 - same as 1000 but meant for t2
State 2001 - same as 1001 but meant for t2
State 2004 - same as 1004 but meant for t2.
If you ever wonder if state: 1004/2004 can allow to pick other types, the anwser is no.Its designed to pickup only weapons.In windmill gjp mod it been used to change the t0 into your team but he grabbed them with ik3 +cpoint that lead the t0 into a frame with state: 1004 not picked them up.state: 2004 designed only for t2.
Also hiting a weapon (lets say rock but its not really matter) change it to your team.Its apply to all types expect t0 but this is a weapon tut.
Type 1:
Light weapons such as baseball bat,hoe,knife,boomerang,freeze ice sword,herny arrows&rudolf shorinken.
When you hold a t1:
attack = you go to frame 20/25 ,jump+attack=you go to frame 80,jump/dash+attack+direction=you go to frame 52,dash+attack=you go to frame 40,run+attack+direction=you go to frame 35,run+attack+direction=you go to frame 45.That apply to all the weapons except t2.
With knife & boomerang the id react to direction+attack also from stading frames.I'm saying this cause I messed with weapons ids to test it.I mean they don't react to the weapon inputs like the normal t1 because of the id that is.
Just a small note: when I'm saying the weapon going to set of frames I mean the weapon goes to first frame & to other aswell with next value.I do not mean its randomly goes to frame in the frame set.
When throwing weapons(all expect t2)they go to frames 40-55(throwing)&when they hit(or being hit by) an object they go to frame 0-15 .From there weapons go to frame 70-72 & then to 60-64. The weapons stay in frame 64 with state: 1004 .When throwing weapons(expect t2)& they just hit the ground they go to frames 70-72 & then frames 60-64.
Herny &Rudolf herny opoint their range weapon in the punching frames.The range weapon itself being opoint in frame 40(first frame of throwing).
Character that fall & drop a weapon(not a t2) due to state: 12 cause the weapons to go to frame 0-15.Character can be sent to the falling frames also by the fire frames(203-206) &the ice frames(200-202).Also due state: 10 in picked_caught frames(130-144).
Type 2:
Heavy weapons such as boulder,box&louis Armor.When picking up a t2 its send the character to frame 12-15(Heavy_obj_walk).Running while holding a t2 using frames 16-19(Heavy_obj_run).Pressing attack with a t2 send the character to frame 50 at any situation.frames 0-5 are used both to throw the t2 & falling from the sky for the t2.Frame 10 being used to hold the t2 but I guess you could use other frames as well.t2 will go to frame 21 after its hit the ground &from there its goes to frame 20 with state: 2004 next: 0.
When hurting a character that hold a t2 the character will be sent to ,frames 220-229(injury),falling,fire,ice & drop the t2 .You can only hold a t2 in frames 12-15 unless you opoint it using opoint kind: 2.
The t2 will be sent to frames 0-15.If you hit a t2 in mid air then it cause it to bounce in frame 0-15(its also change that boulder team to your team & count the damage).I assume it bounce to frame 0.
Type 4:
Weapon for throwing such as the baseball.You could use this for weapon such as grenade.The baseball will always regard to attack as throw at any situation since its defined for type 4 with ids 199-100 in the exe.If you change the id of the baseball to other ids then it won't regard the attack button as throw command from standing frames.
When a t4 hit the ground its(bounce) goes back to frames 40-55 & then go to frame 70-72 and finally to 60-64 .Frame 64 state: 1004 &next: 0.When t4/6 being hit by itr in some situations they bounce(frame 40-55) in mid air.If its an enemy itr the ball will change teams and hit the original owner.
Type 6:
Weapons for drinking.The ids here have a major role.Milk bottle will give hp/mp only with id 122 &same goes for the beer.Its has to be id 123 otherwise its won't give mp when you drink it.In this type press attack while standing= frame 53-58(weapon drink).The ai will runaway while hold a t6(defined in the exe).Surely people can abuse this somehow.Not much to say. Its act just like a t4 when its hit the ground & bounce if it being hit in some situations just like t4.
Weapon are picked up using ik2/7 which react only to state: 1004/2004
with a bdy.Ik2/7 works only with the attack input & only on the first frame. You can't use it on the second frame.It won't work.Also it doesn't work automaticly(like a normal itr does) you have to press attack inorder to active it.
When a ik2 detect a bdy of a weapon its send the character to frame 115(picking_light)/116-117(picking_heavy).If its a heavy weapon then the character goes to frame 12(heavy walk).IK7 does the sames thing ,only the weapon will move directly to the character hand without the character going to the pickup frames .Ik7 can't pickup heavy weapons ,cause if it did then you could pickup a boulder while rolling.
Also when you pickup a weapon the game knows how to handle it unlike opoint with kind: 2 which handle all the types you spawn as a t1(meaning attack = frame 20/25).
Opoint kind: 2 should be used only for t1.
Code: opoint:
kind: 2 x: 42 y: 51 action: 35 dvx: 0 dvy: 0 oid: ??? facing: 0
opoint_end:
Weapon react to the weaponact in the character wpoint & accordingly goes to the frames.In a frame the character has weaponact: 35 the weapon will be in his 35 frame.A useful thing to do with it is to deleting weapons using weaponact: 1000(same as next: 1000,vaction: 1000& etc).
When making a character always have a wpoint in the attacks .If you don't you could destroy your weapon by hitting it.Woody has a wpoint in his D^a attack which prevent him from damaging the weapon he hold in his hands.I assume the the weapon is being held in frame 0-15 if the character doesn't have a wpoint during an attack.
Also I might mention that weapons(all except t2 again) don't have bdy in on the hand frames.
Wpoint kind: 3 used to drop weapons(used in freeze ice sword summoning).
Wpoint kind: 2 used to set the weapon holding coordinates(I will update about it)& the weapon might not react if there no wpoint kind: 2 .
Wpoint kind: 1 with dxy dvy values is the throwing. I tried to throw other types (not weapons) .It didn't work.Its designed for weapons apparently.
Code: wpoint:
kind: 1 x: 102 y: 60 weaponact: 35 attacking: 0 cover: 0 dvx: 14 dvy: -4 dvz: 3
wpoint_end:
wpoint kind: 1 with attacking: 1-4
Active the ik5 in weapons and use the strength list in the weapon to determine the strength of the ik5(yes yes I know this ik5 thing is in the mainsite).
Code: <weapon_strength_list>
entry: 1 normal
dvx: 2 fall: 40 vrest: 10 bdefend: 16 injury: 40
entry: 2 jump
dvx: 7 fall: 70 vrest: 10 bdefend: 16 injury: 40
entry: 3 run
dvx: 10 fall: 70 vrest: 10 bdefend: 16 injury: 50
entry: 4 dash
dvx: 12 fall: 70 vrest: 20 bdefend: 60 injury: 50
<weapon_strength_list_end>
Code: wpoint:
kind: 1 x: 50 y: 53 weaponact: 23 attacking: 1 cover: 0 dvx: 0 dvy: 0 dvz: 0
wpoint_end:
Code: entry: 1 normal
dvx: 2 fall: 40 vrest: 10 bdefend: 16 injury: 40
Example for ik5 in the lf2 stick(aka baseball bat).
Code: <frame> 23 on_hand
pic: 23 state: 1001 wait: 0 next: 0 centerx: 24 centery: 40
wpoint:
kind: 2 x: 9 y: 33 weaponact: 0 attacking: 0 cover: 0 dvx: 0 dvy: 0 dvz: 0
wpoint_end:
itr:
kind: 5 x: 33 y: 15 w: 13 h: 11 dvx: 8 fall: 20 bdefend: 16 injury: 789
itr_end:
itr:
kind: 5 x: 5 y: 24 w: 25 h: 11 dvx: 8 fall: 20 bdefend: 16 injury: 789
itr_end:
itr:
kind: 5 x: -18 y: 33 w: 31 h: 10 dvx: 8 fall: 20 bdefend: 16 injury: 789
itr_end:
<frame_end>
In the strength list you could use any effect/value you desire.
Weapons can also use the hit Fa: tags like in balls.Anyway in the boomerang the throwing frames got a tag hit_Fa: 3 which make it to chase a bit.
Update:
(01-19-2010, 10:12 PM)YinYin Wrote: bluna has a custom broken weapon
julio has a custom broken weapon
the sandbag has a custom broken weapon
all with weapons holding another object - not necessarily a weapon
most important is that the broken action in that object starts at frame 0 - you can there put your animation/opointing
I saw that but didn't notice.Thanks to YinYin.
Well then.I'm sure there stuff to be fixed & I will take care of that.I will be glad to hear opinions/advices to improve the tut.If the tut order is too messy for some people I will rewrite the guide. Pay attention that this is only my dc knowledge about weapons & I might lack some info about weapons,so your are welcome to correct me.
RE: Weapon tutorial - Alblaka - 10-15-2009
Wow, great tutorial ^^
Since i'm not really experienced in DC of weapons i won't be able to find any wrong information anyways XD
RE: Weapon tutorial - YinYin - 10-16-2009
i think the ai actually limits itself to the ids used by the original weapons and not 100-199
not sure tho
RE: Weapon tutorial - x90z75ek - 10-16-2009
Excellent tutorial! Only 1 mistake: "The ai(computer player) try to pickup weapons with id 100-199 & state: 1004/2004."
YinYin was right, the computer players also try to pick up other weapons like: weapon7 ice_sword which is id: 213
RE: Weapon tutorial - TheNave - 10-16-2009
wut? there's nothing about ID on the weapons uppicking ai stuff... it's all about the state only
RE: Weapon tutorial - x90z75ek - 10-16-2009
@TheNave; that's what I said. He said ai picks up only weapons with id 100-199.
RE: Weapon tutorial - YinYin - 10-17-2009
(10-16-2009, 09:37 PM)TheNave Wrote: wut? there's nothing about ID on the weapons uppicking ai stuff... it's all about the state only
nope
try changing the id of normal weapons to something never used by the game - the ai will not try to pick it up anymore
RE: Weapon tutorial - Lauli - 10-17-2009
He's right.
AI will only react to weapons that have a corresponding broken_weapon.
Not really actually, but the AI only will pick up the original weapons of LF2, not the ones you add.
Except they stand directly above the weapons and punch...
RE: Weapon tutorial - TheNave - 10-17-2009
o rly?
*changing id of ice sword*
...
dammit, he was right
RE: Weapon tutorial - Madara Uchiha - 10-17-2009
Oh. I never knew that. I thought as long as it had the same type as a weapon it could pick it up.
|