Page 9 of 9

Re: Assign attacks

Posted: Fri Jan 11, 2013 12:23 am
by MBK_MBK
IrateGiant wrote:Te e enviado los archivos MBK! Comprobaré el código que as posteado! Gracias! :D :wink:
¿Qué parte concreta del código quieres que mire?

Ah vale, ya leí tu correo y el archivo Leeme.txt :)

Para poder probar tu mod, tengo que hacer otra instalación nueva de Blade... en fin.
Cuando tenga tiempo me pongo a ello. :wink:

Nos vemos! :mrgreen:

Re: Assign attacks

Posted: Fri Jan 11, 2013 9:59 am
by IrateGiant
Muchas gracias MBK! :mrgreen:

EDIT/

He conseguido correjirlo MBK!! :mrgreen:

Este es el código:

Code: Select all

#---------RAGNAR-----------------------

elif PlayerName == "Ragnar":
	if os.path.exists ("../../Config/Ragnar.cfg"):
      char=Bladex.CreateEntity("Player1","Ragnar",-87966.6,87.7,9894.2, "Person")
		char.Level=13
		char.Data=PlayerTypes.Orc(char)
		rsw=Bladex.CreateEntity("RHandWP","Martillo",0,0,0,"Weapon")
		lsw=Bladex.CreateEntity("LHandWP","Escudo7",0,0,0,"Weapon")
		Sparks.MakeShield(lsw.Name)

char.Angle=4.2

char.Data.ResetSounds("Player1")
char.SendTriggerSectorMsgs=1
char.SetOnFloor()
inv=char.GetInventory()

o=Bladex.CreateEntity("LHandWP","Escudo1",0,0,0)
ItemTypes.ItemDefaultFuncs(o)
Sparks.MakeShield("LHandWP")
#inv.AddShield("LHandWP")
inv.LinkLeftHand("LHandWP")

o=Bladex.CreateEntity("RHandWP","Espadaromana",0,0,0,"Weapon")
ItemTypes.ItemDefaultFuncs(o)
#inv.AddWeapon("RHandWP")
inv.LinkRightHand("RHandWP")
Lo que no soy capaz de lograr, es mostrar los ataques mágicos y los sonidos propios de los personajes . :(

Saludos!!

Re: Assign attacks

Posted: Wed Jan 16, 2013 10:00 pm
by Guest
¡Estupendo Irate! :)

Sobre asignar sonidos a las animaciones de los personajes, están en:
.../Scripts/
Por ejemplo, para la amazona: AniSoundAmz.py y AniSoundAmzX.py.

También están asignados en:
.../Lib/ BasicFuncs.py

Code: Select all

def ResetSounds(self, EntityName):
		me=Bladex.GetEntity(EntityName)
		kind=me.Kind[:len(me.Kind)-2]
		if kind=="Barbarian":
			AniSound.AsignarSonidosBarbaro(EntityName)
		elif kind=="Knight":
			AniSound.AsignarSonidosCaballero(EntityName)
		elif kind=="Dwarf":
			AniSound.AsignarSonidosEnano(EntityName)
		elif kind=="Amazon":
			AniSound.AsignarSonidosAmazona(EntityName)

También están asignados en:
.../Scripts/ ClientInit.py

Code: Select all

#
# Sonidos de los clientes
#
def ClientSoundAsignation(name,kind):
	print "tratando de asignar los sonidos a "+name+" de raza "+kind
	ent = Bladex.GetEntity(name)
	
	if kind == "Knight_N":
		AniSound.AsignarSonidosCaballero(name)
	elif kind == "Amazon_N":
		AniSound.AsignarSonidosAmazona(name)
	elif kind == "Barbarian_N":
		AniSound.AsignarSonidosBarbaro(name)
	elif kind == "Dwarf_N":
		AniSound.AsignarSonidosEnano(name)
	else:
		print "Sonidos para "+kind+"no implementado"
netgame.SetJoinPlayerFunc(ClientSoundAsignation)
print "Sonidos listos"

Tal ve me deje otro archivo más...

___________________________________________

Sobre mostrar ataques mágicos, Mingyue y Prospero lo han conseguido. O sea, han conseguido asignar ataques mágicos o proyectiles a los hérores; pregúntales.

¡Saludos compi! ;)

Re: Assign attacks

Posted: Wed Jan 16, 2013 10:09 pm
by MBK_MBK
Ups, sorry for the last post. It was me, by an error could not connect to my account, but now all is well. :)

Re: Assign attacks

Posted: Mon Jan 27, 2014 5:32 pm
by IrateGiant
Hi again friends! :D I´m back to continue with my mods and my doubts... :oops:

I managed to achieve a significant progress in the mod, but an error occurred that prevents me from continuing:

Code: Select all

[color=#008000][/color]Traceback (innermost last):
  File "Cfg.py", line 37, in ?
    execfile("../../Scripts/BladeInit.py")
  File "../../Scripts/BladeInit.py", line 93, in ?
    import Scorer
  File "..\..\Lib\Scorer.py", line 213, in ?
    wObjectsFrame=ScorerWidgets.B_ObjectsFrame(wFrame,"ObjectsFrame",125,65,char)
  File "../../Lib/Widgets\ScorerWidgets.py", line 498, in __init__
    self.SetChar(char)
  File "../../Lib/Widgets\ScorerWidgets.py", line 619, in SetChar
    self.inv=char.GetInventory()
AttributeError: 'None' object has no attribute 'GetInventory'
B_App::RunScriptFile() -> Error ejecutando Cfg.py 
Start optimizing Astar...B_App::LoadWorld() -> Error trying to load PP.
OK!
[color=#008000][/color]
That code apears on console and that is my "pj.py" file:

Code: Select all

[color=#008000][/color]import Bladex
import AniSound
import Actions
import ItemTypes
import Reference
import Sparks
import Basic_Funcs
import Ragnar_NData
import Ragnar_NTypes
import ChaosKnight_NData
import ChaosKnight_NTypes
import Minotaur_NData
import Minotaur_NTypes
import Little_Demon_NData
import Little_Demon_NTypes
import DalGurak_NData
import DalGurak_NTypes
import os


store_char = open("../BeastMap/mapdata.txt",'r')
PlayerName=store_char.read()
if store_char:
        store_char.close()


if PlayerName == "Ragnar_N":
	char=Bladex.CreateEntity("Player1","Ragnar_N",0,0,0, "Person")
        char.Position=0, -1118, 0
        char.Data=Ragnar_NTypes.Ragnar(char)
        char.Angle=0.0
        char.Level=3
        inv=char.GetInventory()

        o=Bladex.CreateEntity("EscudoInvPrb2","Escudo1",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)

        o=Bladex.CreateEntity("WeaponInvPrb1","Espadaromana",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)


elif PlayerName == "ChaosKnight_N":
	char=Bladex.CreateEntity("Player1","ChaosKnight_N",0,0,0, "Person")
        char.Position=0, -1118, 0
        char.Data=ChaosKnight_NTypes.ChaosKnight(char)
        char.Angle=0.0
        char.Level=3
        inv=char.GetInventory()

        o=Bladex.CreateEntity("EscudoInvPrb2","Escudon",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)

        o=Bladex.CreateEntity("WeaponInvPrb1","Espadon",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)


elif PlayerName == "Minotaur_N":
	char=Bladex.CreateEntity("Player1","Minotaur_N",0,0,0, "Person")
        char.Position=0, -1118, 0
        char.Data=Minotaur_NTypes.Minotaur(char)
        char.Angle=0.0
        char.Level=3
        inv=char.GetInventory()

        o=Bladex.CreateEntity("WeaponInvPrb1","Hachacarnicero",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)


elif PlayerName == "Little_Demon_N":
	char=Bladex.CreateEntity("Player1","Little_Demon_N",0,0,0, "Person")
        char.Position=0, -1118, 0
        char.Data=Little_Demon_NTypes.Little_Demon(char)
        char.Angle=0.0
        char.Level=3


elif PlayerName == "DalGurak_N":
	char=Bladex.CreateEntity("Player1","DalGurak_N",0,0,0, "Person")
        char.Position=0, -1118, 0
        char.Data=DalGurak_NTypes.DalGurak(char)
        char.Angle=0.0
        char.Level=3
        inv=char.GetInventory()

        o=Bladex.CreateEntity("EscudoInvPrb2","DalShield",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)

        o=Bladex.CreateEntity("WeaponInvPrb1","DalWeapon",0,0,0,"Weapon")
        Actions.TakeObject(char.Name,o.Name)
        ItemTypes.ItemDefaultFuncs (o)
[color=#008000][/color]
Anyone see the problem?

Re: Assign attacks

Posted: Tue Jan 28, 2014 8:46 pm
by prospero
Put an else clause at the end.

Code: Select all

else:
    print "no player created"
It won't cure it but it will establish that the Player has been created.

Re: Assign attacks

Posted: Tue Jan 28, 2014 11:46 pm
by IrateGiant
Same error Pro... Is it possible that the problem comes from another file?

I can´t find any solution :(

Re: Assign attacks

Posted: Wed Jan 29, 2014 9:50 pm
by prospero
Seems that the Player is not being created.

Try this way....

Write the mapdata file as with a .cfg extension.

Place it in the MainFolder/Config folder.

To read it....

Code: Select all

PlayerName = "Ragnar_N" # pre-declare the var as a failsafe

try:
	execfile("../../Config/mapdata.cfg")
except:
	pass
Check the saved mapdata.cfg to make sure the correct code is written.

PlayerName = "Ragnar_N" # or whatever

Re: Assign attacks

Posted: Mon Feb 03, 2014 5:50 pm
by IrateGiant
Sorry Pro, but nothing, the same message appear. I'm trying to edit the "pj.py" to fix the problem, but without success.

I don´t know the cause of the error. :|

Re: Assign attacks

Posted: Tue Feb 04, 2014 1:14 am
by prospero
It's probably not the pj.py but something it is referencing. This sort if bug is hard to pin down.