Assign attacks

Talk about Severance Blade of Darkness modifications and maps here. No tips or tech support questions please, use the forum above. Note that the game is rated 18 so some content may be unsuitable for younger readers.

Moderators: Ade, prospero

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Sun Dec 11, 2011 3:14 pm

StartMap cfg contain;

os.remove "BODPak.dat" and "pf.pak",

LoadBar

execfile "sys_init.py" and "BladeInit.py"

ReadLevel "startmap.lvl"

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Sun Dec 11, 2011 6:32 pm

I'm not sure I understand you.

If you load a 'game' map from your MainModLevel it works ok, but if you load 'NewMap' it gives the "Player 1 duplicated" error. Is that the problem?

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Sun Dec 11, 2011 6:41 pm

Yes SR, that's exactly the problem. Sorry, if I don´t explain well. [:)]

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Sun Dec 11, 2011 10:52 pm

I just tried the 'char.RemoveFromWorld()' method with 2 of my mod maps and it worked ok, the second map loaded with it's own "Player".

I can't tell what's wrong with your code unless I see the files.

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Sun Dec 11, 2011 11:24 pm

OK SR, check your mail please.

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Sun Dec 11, 2011 11:26 pm

Use this email:
[email protected]

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Sun Dec 11, 2011 11:34 pm

Done.

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Sun Dec 11, 2011 11:53 pm

Ok,
I found these functions in Palanca.py (they should really be in DefFuncs.py, for savegame stability)

Code: Select all

def Abredoor1(): GotoMapVars.EndOfLevel() Bladex.LoadLevel("StartMap") def Abredoor2(): GotoMapVars.EndOfLevel() Bladex.LoadLevel("StartMap") def Abredoor3(): GotoMapVars.EndOfLevel() Bladex.LoadLevel("StartMap") def Abredoor4(): GotoMapVars.EndOfLevel() Bladex.LoadLevel("Barb_M1") def Abredoor5(): GotoMapVars.EndOfLevel() Bladex.LoadLevel("Ragnar_M2")
They should look like this:

Code: Select all

def Abredoor1(): char=Bladex.GetEntity("Player1") char.Freeze() char.RemoveFromWorld() Bladex.LoadLevel("StartMap")
You don't need 'GotoMapVars.EndOfLevel()' if you'restarting a fresh map with new player.

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Mon Dec 12, 2011 12:08 am

Work SR! Now I can continue with the mod. Thanks! [;)]

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Mon May 21, 2012 8:57 am

Hi again guys! [:)]

I've been busy in last months but I returned in last days to modding and bring a little doubt.

I´m trying to create a sequence with levers but I don´t have idea.

This is the problem:

From the main map of my mod, I active a lever <font color="green">(palan)</font id="green">, this lever send me to the second map but not finish to load the map because the file "pj.py" of second map have a error in code:

<font color="green">if entityname == "palan":
char=Bladex.CreateEntity("Player1","Knight_N", 0, -1118, 0, "Person")
char.Level=2
char.Angle=4.5
char.Data=Basic_Funcs.PlayerPerson(char)
char.Data.ResetSounds("Player1")
char.SetOnFloor()</font id="green">

The error is <font color="green">if entityname == "palan":</font id="green">

What code I need to fix this error? Thanks!

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Mon May 21, 2012 12:40 pm

What have you assigned to the varianle 'entityname' ?

When you load a new map, all vars from the old map are lost. To pass a variable from one map to another, the easiest way is probably for the first map to create a text file and store the value of 'entityname' in it, and then the second map should open this file and read 'entityname' from it.

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Mon May 21, 2012 10:11 pm

I forget the func SR, I tried to assign the EntityName but I don´t have many ideas about how do this.

I placed this code on <font color="green">DefFuncs.py</font id="green"> from the main map(MAP1):

Code: Select all

<font color="green">def ChooseEnemie(EntityName): char=Bladex.GetEntity(EntityName) if char.Kind=="palan": char.RemoveFromWorld() Bladex.LoadLevel("MAP2")</font id="green">
And this code on <font color="green">pj.py</font id="green"> from the second map(MAP2):

Code: Select all

<font color="green">if GetEntity == "palan": char=Bladex.CreateEntity("Player1","Knight_Traitor", 0, -1118, 0, "Person") char.Level=2 char.Angle=4.5 char.Data=Basic_Funcs.PlayerPerson(char) char.Data.ResetSounds("Player1") char.SetOnFloor()</font id="green">
The console message persist:

<font color="red">File "pj.py", line 32, in ?
if GetEntity == "palan":
NameError: GetEntity
B_App::RunScriptFile() -> Error ejecutando Cfg.py
Start optimizing Astar...B_App::LoadWorld() -> Error trying to load PP.
OK!</font id="red">


The original problem with functions in "Palanca.py" that we talk above is solved but now I´m trying to assign a <font color="green">"palan"</font id="green"> to a character in (MAP2); for example:

<font color="green">"palan" -> "Knight_Traitor"

"palan2" -> "Skeleton"

etc...</font id="green">

I know that this code don´t is correct writen, I tried to adapt from another code sequence. [:(]

Any idea?

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Tue May 22, 2012 12:52 am

In your first map, you need to assign "palan" or "palan2" to the variable 'EntityName', and then call this func
ChooseEnemie(EntityName)

Funcs:

Code: Select all

def ChooseEnemie(EntityName): charname = "Skeleton" if EntityName=="palan": charname = "Knight_Traitor" elif EntityName=="palan2": charname = "Skeleton" store_char = open("map2mapdata.txt", 'w') store_char.write(charname) if store_char: store_char.close()
and put this in pj.py of map 2:

Code: Select all

store_char = open("map2mapdata.txt",'r') charname=store_char.read() if store_char: store_char.close() char=Bladex.CreateEntity("Player1",charname,0,0,0,"Person")
I don't know if that will work as is, but it's on the right track...

User avatar
IrateGiant
Dragon
Posts: 328
Joined: Fri Jan 08, 2010 12:35 pm
Location: Spain
Contact:

Postby IrateGiant » Tue May 22, 2012 1:34 am

Yes, it´s the right track SR! [:)]

I noticed from console to a syntax error from:

<font color="red">

Code: Select all

store_char = open("map2mapdata.txt",'r') charname=store_char.read() if store_char: store_char.close()</font id="red">
I adapt him to this and now still loading.

<font color="green">

Code: Select all

store_char = open("map2mapdata.txt",'r') charname=store_char.read() if store_char: store_char.close()</font id="green">
But now the problem is "map2mapdata.txt" that no exist this file...

I change the name "<font color="green">map2</font id="green">mapdata.txt" to another map name for example "StartMap", but what happens? I need to create a file named "...mapdata.txt"?

I don´t know if I follow the right track [:D] but I create the file "...mapdata.txt" but empty and show a message:

<font color="red">Trying to create a Person that was NOT preloaded:",</font id="red">

I need write something in this file?

Sir Random
Dragon
Posts: 737
Joined: Thu Nov 15, 2001 12:58 am
Location: Ireland
Contact:

Postby Sir Random » Tue May 22, 2012 1:52 am

The "map2mapdata.txt" file should have been created, and the EnemyName written to it, by the func:
<font color="green">ChooseEnemie(EntityName)</font id="green">
At the end of map 1.

Did you call this func with EntityName = "palan" or "palan2"? If not, the "map2mapdata.txt" file would not exist.

You can test it like this (map 1)
<font color="green">
EntityName = "palan"
ChooseEnemie(EntityName)</font id="green">

or you can put "Knight_Traitor" in the "mapdata.txt" file to test map 2.


Return to “Severance BoD: Modding Community”

Who is online

Users browsing this forum: Google [Bot] and 1 guest