Level Editing: Scripting

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: prospero, Ade

User avatar
Tomash
Dragon
Posts: 247
Joined: Sat Oct 25, 2008 11:23 am
Location: Russia
Contact:

Re: how to see map sector

Post by Tomash »

cieply wrote: and now actual question:
how can I see it?
U can alter textures of visible sides of sector (floor for example). Look for "Blade TV" by Sir Random for details:
http://www.arokhslair.net/forum/viewtop ... =11&t=3081

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

Re: Re: how to see map sector

Post by cieply »

it's not that - I meant to see whole sector, all its parts - visible or not
for example - do you remember last scene with vampire in Abyss map? there is this "arena" where he appears and this is a single sector - all I wanted to see where the sector is, either by filling it with atmosphere (this one turned out impossible without map source and compiling it) or making an object (cube) that fills the sector and only sector so I can see where actually sector is and what are its boundaries

but now I guess it is not doable by any possible way, so let it be

thank you for help anyway
Last edited by cieply on Thu Sep 01, 2016 7:09 pm, edited 1 time in total.
l'aria fresca,
vino puro, ...

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

Re: how to see map sector

Post by cieply »

prospero wrote: I do have a version of the Mines map .mp file. But the end is different to the release version. You come out the rolling balls tunnels and there is just a wall ahead. :(
I wanted to see the sector where the rune is so I don't need tunnels
prospero wrote: No way the alter the atmos on an individual sector any other way I'm afraid. Unless you can read hex code.
honestly, I would prefer it this way
but I don't know the map structure although I found something on bigtruck - I guess it would be easier than compiling
prospero wrote: :( I have all the other .mps which are all complete. If anybody ever wants one.
if you had one I appreciate that
just would try to add the atmosphere to that one sector and compile to see how it works
can you "borrow" this map for a while?
l'aria fresca,
vino puro, ...

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

Re: Level Editing: Scripting

Post by cieply »

krehmall wrote: thats what it writes its original ragnar map.(((((
you need to see what happens when you run EBrowser, not a map - it's useless

do this:
before you run Ebrowser in console clean a log file (in any text editor)
then run EBrowser and see what is inside the log file
if it won't help, try to add some debug prints in EBrowser so you can see what works and what doesn't
for example

alter this original code:

Code: Select all

        GmenuBar.addmenuitem('File', 'command', 'Generate a python file',
                command = self.GenScript,
                label = 'Generate Script...')
to:

Code: Select all

 
       print ("i'm here: GmenuBar.addmenuitem")
       GmenuBar.addmenuitem('File', 'command', 'Generate a python file',
                command = self.GenScript,
                label = 'Generate Script...')
       print ("i'm here: GmenuBar.addmenuitem - > GmenuBar.addmenuitem")
if you'll see it working then "printf debug" GenScript()

Code: Select all

    def GenScript (self):
	global DummyName
        if self.Ent.Type == DummyName:
	   return

        filename = tkFileDialog.asksaveasfilename(parent=self.Parent,filetypes=[("Python scripts","*.py")])
        print ("filename=%s") %(filename) 
        if not filename:
           return
and so on until result - place where it crashes/exits

I guess that's the possible way

say what you've found out

ed:
you can try also read this:
http://translate.googleusercontent.com/ ... kS890uGgqg
and use this EBrowser patch:
http://reido-grunge.narod.ru/toolsrus.html
l'aria fresca,
vino puro, ...

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

heavy club as 2-handed axe (for barbarian)

Post by cieply »

cieply wrote:I tried to make Heavy club 2-handed weapon by changing $BOD/Lib/Reference.py

Code: Select all

DefaultObjectData['Garrote2']=           [OBJ_WEAPON,175, -50, 2.8,  THR_SPINNING, [W_FLAG_1H,]]
to:

Code: Select all

DefaultObjectData['Garrote2']=           [OBJ_WEAPON,175, -50, 2.8,  THR_SPINNING, [W_FLAG_AXE,]]
but it didn't work in Shalatuwar (Orc_M9) where the weapon exists
I got whole bunch of errors:
Sryml wrote: Because the handed weapon can use block, so you need to add some defense parameters. Like this:

Code: Select all

DefaultObjectData['Garrote2']=           [OBJ_WEAPON,175, -50, 2.8,  THR_SPINNING, [W_FLAG_1H,]]
to

Code: Select all

DefaultObjectData['Garrote2']=           [OBJ_WEAPON,175, -50, 2.8,  THR_SPINNING, [W_FLAG_AXE,PI,2000,750,400,400,GolpeArmaEscudoMetal]]
these parameters worked fabulous and then some problems occurred
during the chieftain great orc animation console had been flooded with warnings:

3D DEPT------------------------------------------
CRITICAL ERROR in LaunchMyMpxAnim(EventFuncs.cpp)
Action Rlx_axe does not exist!!!
Biped is Gok
-------------------------------------------------

and then when the orc comes from behind the door game crashed with this messagebox:
CRITICAL ERROR in StartDirection -> Action JOG , biped Gok , without action!

I conclude from this that the problem is lack of axe animation set for great orc. Is there any way to avoid it or to improve because it looks like neverending story in this case. Maybe better was to create totally new weapon with heavy club model?
l'aria fresca,
vino puro, ...

User avatar
prospero
Ancient Dragon
Posts: 1735
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Re: Level Editing: Scripting

Post by prospero »

cieply - I'll dig out the mines .mp and upload it. You can run it in a separate test map. 8)


Don't give enemies 2H swords or 2H clubs or axes. They will hold them OK, but as soon as they try to move the game will crash. :?

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

Re: Level Editing: Scripting

Post by cieply »

prospero wrote: Don't give enemies 2H swords or 2H clubs or axes. They will hold them OK, but as soon as they try to move the game will crash. :?
yes, I've noticed :)
that means I should make it a new weapon with heavy club model

is it possible to make a new weapon with old (existing) model? I found in fugitiveI an example
as far as I understand this is using new model Barbieclub.bod with mesh "BarbieClub"

Code: Select all

	Reference.DefaultObjectData['BarbieClub']=[Reference.OBJ_WEAPON,450, -80, 4.0,  Reference.THR_SPINNING, [Reference.W_FLAG_AXE,Reference.PI,2000,750,12000,120000,Reference.GolpeArmaEscudoMetal]]
	Reference.DefaultSelectionData['BarbieClub']=(8.0,4000.0,"Stone Club")
can I do it with existing model (here Garrote2)? cause it seems to be connected with meshes name 'BarbieClub'

or I have to copy it and change internal name of mesh?
like:
$ cd $BOD/3DObjs
$ cat garrote2.bod | sed s/Garrote2/Cudgel_2/ > cudgel_2.bod

then

Code: Select all

BBLibc.LoadBOD("..\\..\\3DObjs\\cudgel_2.bod") 
BBLibc.ReadBOD("..\\..\\3DObjs\\cudgel_2.bod") 
and in $BOD/Lib/Reference.py

Code: Select all

DefaultObjectData['Cudgel_2']=[OBJ_WEAPON,175, -50, 2.8,  THR_SPINNING, [W_FLAG_AXE,PI,2000,750,400,400,GolpeArmaEscudoMetal]]
DefaultSelectionData['Cudgel_2']=(8.0,4000.0,"Heavy Cudgel")
or in separate script

Code: Select all

Reference.DefaultObjectData['Cudgel_2']=[Reference.OBJ_WEAPON,175, -50, 2.8,  Reference.THR_SPINNING, [Reference.W_FLAG_AXE,Reference.PI,2000,750,400,400,Reference.GolpeArmaEscudoMetal]]
Reference.DefaultSelectionData['Cudgel_2']=(8.0,4000.0,"Heavy Cudgel")
it works and I created new weapon

Code: Select all

o1=Bladex.CreateEntity("Heavy_Cudgel_1","Cudgel_2",x1,z1,y1, "Weapon")
but got message from console: El Objeto Heavy_Cudgel_1 no es rompible
but it looks like minor deficiency, btw. why is that?

resuming - it involves copying models which I wanted to avoid, is it possible?
l'aria fresca,
vino puro, ...

User avatar
prospero
Ancient Dragon
Posts: 1735
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Re: Level Editing: Scripting

Post by prospero »

You can re-classify any individual weapon like this:

Code: Select all

Reference.EntitiesObjectData["IndividualNameOfWeapon"]=[Reference.OBJ_WEAPON, 40, -10, 2.5,  Reference.THR_SPINNING, [Reference.W_FLAG_2W,Reference.PI,2000,750,500,1000,Reference.GolpeArmaEscudoMetal]]
That converts whatever weapon into a 2-handed sword. Do it the other way round and you can convert say a Rhino Club to a 1-handed weapon which enemies can use. But like a 1-handed weapon. Just copy the list from Reference.py, but add in Reference. before any parameters that are declared in the file.

The code needs to go in DefFuncs.py or they will revert in the savegame.

User avatar
prospero
Ancient Dragon
Posts: 1735
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Re: Level Editing: Scripting

Post by prospero »

but got message from console: El Objeto Heavy_Cudgel_1 no es rompible
but it looks like minor deficiency, btw. why is that?
Not important. Ignore it. :D

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

Re: Level Editing: Scripting

Post by cieply »

prospero wrote:You can re-classify any individual weapon like this:
(...)
I don't understand what EntitiesObjectData does but I think it's not what I meant

I meant to (let's make an example) make a new weapon: "cudgel" which is 2-handed axe that would use heavy club's model (garrote2), and all this without copying garrote2.bod to cudgel_2.bod
is it possible?
l'aria fresca,
vino puro, ...

User avatar
prospero
Ancient Dragon
Posts: 1735
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Re: Level Editing: Scripting

Post by prospero »

You don't need to make a clone model unless you wish to reskin it or add extra anchors/edges. You can create a Garrote2 and alter any or all of it's characteristics with the code I posted. All the other Garrote2s in the game will not be affected.

You can even set it's individual onscreen label

Code: Select all

Reference.EntitiesSelectionData["MyPersonalGarrote2"]=(7.0, 4000, "Cudgel")

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

new weapon, old model... cont.

Post by cieply »

now, I think I understand

did you mean something like that:

Code: Select all

# chodzi o to zeby create Garrote2 object and then change properties of this particular object
#
# char.Position=(8056.24422816, 20226.9378113, 37330.2597031)
# char.Orientation=(0.650438427925, 0.650437653065, 0.277362793684, -0.277363538742)
o1pos=(1150.27203554, 18862.7797009, 31956.4852995)
o1=Bladex.CreateEntity("Heavy_Cudgel_b", "Garrote2", o1pos[0], o1pos[1], o1pos[2], "Weapon")
o1.Scale=1.0
o1.Orientation=(0.262401580811, 0.132347360253, 0.704923629761, 0.645532548428)
ItemTypes.ItemDefaultFuncs(o1)

# as 2-h sword
Reference.EntitiesObjectData["Heavy_Cudgel_b"]=[Reference.OBJ_WEAPON,175, -10, 2.5,  Reference.THR_SPINNING, [Reference.W_FLAG_2W,Reference.PI,2000,750,500,1000,Reference.GolpeArmaEscudoMetal]]
# as 2-h axe
Reference.EntitiesObjectData["Heavy_Cudgel_b"]=[Reference.OBJ_WEAPON,175, -10, 2.5,  Reference.THR_SPINNING, [Reference.W_FLAG_AXE,Reference.PI,2000,750,500,1000,Reference.GolpeArmaEscudoMetal]]
Reference.EntitiesSelectionData["Heavy_Cudgel_b"]=(7.0, 4000, "Heavy Cudgel")
#
There is however some problem with this code - when new weapon is held it somehow prevents cycling weapons.
To change weapon I have to throw out Heavy_Cudgel_b and then I am able to cycle weapons again.
Did you experience something like that?
l'aria fresca,
vino puro, ...

User avatar
prospero
Ancient Dragon
Posts: 1735
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Re: Level Editing: Scripting

Post by prospero »

Can't think why it wouldn't work? :roll:


You do have to put the ref code in DefFuncs.py or the club will revert in the savegame.

Better still, make a standalone file and put all such code in there and import it from cfg.py. Also import it from an ActorsInit.py file. This file is exed during the save load and must have that exact name.

Check out the file obj_def.py in any of my maps. (The later ones anyway....)

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

Re: Level Editing: Scripting

Post by cieply »

prospero wrote:You do have to put the ref code in DefFuncs.py or the club will revert in the savegame.
Better still, make a standalone file and put all such code in there and import it from cfg.py.
that's what I always do (at least for some time now :- ), it saves me lot of problems, especially with detecting what modification of DefFuncs.py is meant do do what
prospero wrote: Also import it from an ActorsInit.py file. This file is exed during the save load and must have that exact name.
Check out the file obj_def.py in any of my maps. (The later ones anyway....)
this one I don't know - i'll check
l'aria fresca,
vino puro, ...

User avatar
cieply
Dragon
Posts: 335
Joined: Wed Jun 26, 2013 3:43 pm

music volume level

Post by cieply »

i have the another question, although it is probably simple, I hope

in some maps there are areas where music volume increases
I cannot "detect" how is it done and how to manage it - I just want to decrease a little level of volume there cause I use volume==1 and thjis seeems to use 10, which gives me pure headache when it's done

someone knows how is it done?

I prepared a map (here it is in Oasis of Nejeb) where behind bars (golem lock) it is done
all you need to do is to open lock and pass the bars and everything will become clear

https://drive.google.com/file/d/0B3DpuQ ... sp=sharing

// I tried to put it on yandex but I'm forced to use public computers with outdated ie so i put on g.drive
// it will be moved to yandex as soon as possible
l'aria fresca,
vino puro, ...

Post Reply