Page 1 of 9

Assign attacks

Posted: Thu Oct 20, 2011 7:58 pm
by IrateGiant
Hi guys! I'm trying to add a attack sequence to a character. I edit the file "...Combos.py" in [Scripts\Combos] folder.

#########################
# GRUPOS DE GOLPES SELECTIVOS #
#########################

#GM1 group
chk.AddAttack("G01","chk_g_01")
chk.AttackTypeFlag("GM1",ATK_UNIQUE)
chk.AddLevels("chk_g_01",0,0)

#################
# GOLPES SELECTIVOS #
#################

#GM1
chk.AllowAttack("G01","A+F","","GM,GM","","1H")
chk.AllowAttack("G01","&A+F","","GM,GM","","1H")

But I dont see any change [xx(]

What files I need to modify to see this changes in game?

Greetings!

Posted: Thu Oct 20, 2011 8:42 pm
by Tomash
For what character do you want to add this attack?

Posted: Thu Oct 20, 2011 9:12 pm
by IrateGiant
I´m trying to make usable the original attacks from ChaosKnight.

Posted: Thu Oct 20, 2011 9:40 pm
by Tomash
Do you want to use the CHKnight as PlayerChar or as NPC?

If you want to add more attack to NPC then you don't need to use the method AllowAttack, but you need to modify the list of attack of this kind of person.

Posted: Thu Oct 20, 2011 10:13 pm
by IrateGiant
I want to test ChaosKnight as Playable character. [:)]

Posted: Thu Oct 20, 2011 10:39 pm
by Tomash
I just tried too, and it works. The only trouble was the loss of energy on 1lvl. I made the character 19lvl to fix it.

Posted: Thu Oct 20, 2011 11:15 pm
by IrateGiant
Thanks Tomash! What files you edit and how to make Chk playable? [:)]

Posted: Fri Oct 21, 2011 3:04 am
by prospero
Hi IG [:D]

Perfectly possible to make the CK playable, but you need to do a lot of work. NPCs generally lack the animations that the Player chars have. Jump/Take/Use stuff mainly. If you simply create "Player1" as a Chaos Knight, he will work and you can walk around. But try to 'use' something or lock a door, etc and the game will crash.

You can add the missing animations with code but it's a messy job. And there are quite few that have to be added. If I were doing it I would clone the CK model and create a completely new race. Then all the data is seperate from the original and you can customise the code without risk of screwing up the original NPC version.

Posted: Fri Oct 21, 2011 5:37 am
by mingyue1371
Hi IG,[:D]
I thought you should also need to modify[or add some stuff] these files:
..\Scripts\ChkBAct.py
..\Lib\AnmSets\ChkAnimationSet.py

Posted: Fri Oct 21, 2011 9:37 am
by Tomash
http://www.youtube.com/watch?v=Xn3h8QMbwdI

Files:
http://www.mediafire.com/?o94elynnvb7is3s

I changed just 3 files:
Scripts/Combos/ChkCombos.py to make the attacks usable

Maps/Barb_M1/pj.py to replace Tukaram with ChaosKnight in Kashgar
Maps/Barb_M1/barb.lvl to load the textures

Posted: Fri Oct 21, 2011 9:42 am
by Tomash
But as Pro said, this character lacks some animations wich are neccesary for PC. And also this model may be too large to pass through some narrow passages in main game.

Posted: Fri Oct 21, 2011 1:49 pm
by prospero
You can assign the "Rlx_no" or "Rlx_1H" animations to the use/take actions in the biped action file. This will stop the crashes and the actions should still work - albeit by telekninesis. [:D]

Not sure if the CK has any strafe or combat facing anims..... [8)]

Posted: Fri Oct 21, 2011 2:31 pm
by IrateGiant
Many thanks pro, mingyue and Tomash! [:D]

Now, I can continue testing this with the correct files!

Tomash: I don´t want play ChK in maingame, I don´t have problem with passages in main game. I test this for a mod. [;)]

pro: I think that your cloned method is more easy but before I need to know what files I need to modify. [:D]

Thanks again! Greetings!

Posted: Fri Oct 21, 2011 2:57 pm
by Tomash
See the scripts of the Pro's "Wizards Domain". It is good example of how to make the new character

Posted: Fri Oct 21, 2011 7:57 pm
by prospero
look in any of my mods that have new characters for folders with *******Stuff. [:D] All the files within relate to an individual new character. The basic set is:

***Data.py - master file to initiate the new race.
***AnimationSet.py - loads the animations.
***BAct.py - sets the Biped actions
***Anm_def.py - Assigns the animation events
***AnmFact***.py - sets the animation timing
***Combos.py - attacks
***Stats.py - tables for life points/resistances and combo damages

Any file specific to the character, put in this folder. I usually start by copying an animation set as near to the new char as possible and then copy/paste/edit animations from others. It's quite complicated so you need to do this gradually or you can get totally cnfused. But having all the files in one folder helps and there is no way it can effect the main game.

I had an idea for a CK map once. You had to guard a doorway a constant stream of dwarfs tried to get past you. Some would attack while others just ran around you. You would have to stop as many as possible. [:D]