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
prospero
Ancient Dragon
Posts: 1726
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Postby prospero » Mon Aug 01, 2005 12:00 am

Cutscenes and camera stuff.[8)]

In most of the cutscenes in the main game the camera moves are handled by hard-coded *.cam files which are created in 3dsmax.
However, it is easy to create them with Python.

What you need are sets of coords. The "Camera" is an entity the same as all other objects in the game. The two properties you need are:

Position (the position of the camera)
TPos (target postion - the point at which it is 'looking')

You need the De-bug mode enabled in order to get accurate coords. Start the map and press 'P' to enable the free camera. You now need to set some key points in the camera travel path. Move the cam to the point where you want to start your cutscene. Press 'T' until you get a readout with the camera position and camera target position. (This screen has lots of other stuff on it: Player Pos/Angle and current animation,etc.) Write down the cam pos and tpos. Move cam to the next stage in its path, note coords again and repeat until you reach the point where you want the cutscene to end.

There is a file Lib/AbreCam.py that handles camera moves nicely. To use, make a function:

Code: Select all

import AbreCam def Cut1(): AbreCam.ResetNode() AbreCam.AddNode((10000, -6000, 80000),(12000,-10000, 67000),0) AbreCam.AddNode((20000, -8000, 70000),(12000,-10000, 67000),7) AbreCam.AddNode((30000, -7000, 86000),(9000,-4000, 56000),8) AbreCam.AddNode((50000, -6000, 98000),(8000,-5000, 40000),4) AbreCam.LastTime=0 AbreCam.AbreCam()


Add as many 'Nodes' as you wish. Each one contains the camera Position followed by the camera TPos. Put in the coords you wrote down earlier. The last arg is the time it takes to complete the move.
In this case it is set to 0 in the first line. When func is called (usually from a trigger sector) the camera moves instantly to the first position. If you set the first time to greater than 0 the camera moves from the current Player veiw to first pos in this time. But, because you cannot be sure just where the Player may be looking at this point, it is better to leave the time at 0 to avoid weird things happening. The camera next moves to the second position, in this case in 7 secs. Then it does all the other moves in order. If the LastTime is set to 0, the cam returns to the Player instantly after the last position is reached. If you set this to greater than 0 it will travel back to the Player in that amount of time. Again, this is best set to 0 in most cases. During the cut, the keyboard input is disabled and the scorer is hidden.

Sometimes this code is a bit restricting and cam moves can be done in other ways, but this is the best method in the majority of situations.

big truck
Dragon
Posts: 103
Joined: Mon Dec 27, 2004 2:13 pm
Location: Canada
Contact:

Postby big truck » Mon Aug 08, 2005 2:52 pm

Hi Pro[:)]

Do you have some good infos about

1/ the particles system? [:p] and all we can do with (dust, waterfalls, etc)...
2/ the hits sparks (weapon on stone)
3/ bolts of lightning and electric sparks
4/ the big bowls of rock rolling on the slopes

... and did you look at your pages in my site (I tried to valorize your tutos[:p])

I know that since you've got your new PC and connexion, a lot of work in the "to do" basket is waiting for you[:D] but if you have time, we all like to read your tutos[:p]

[:D]

Ylor
Hatchling
Posts: 5
Joined: Wed Aug 10, 2005 12:24 am
Location: Sweden

Postby Ylor » Wed Aug 10, 2005 12:27 am

AMAZING WORK! WONDERFUL!

I suddenly just feel I have to make a new BOD map! I can't believe you made such a wonderful collection of tutorials!

(Registered as a user just to write this!)[:I]

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

Postby prospero » Wed Aug 10, 2005 11:19 am

Glad it is of help.[:D]

I'll do waterfalls, etc next.

Now I have got good connection I can wotk on my site again, so I might make a few little demo maps for doors, etc. It is much easier when you have the code in a working situation.

sgi1981
Dragon
Posts: 61
Joined: Sun Aug 14, 2005 8:51 pm
Location: Ukraine
Contact:

Postby sgi1981 » Sun Aug 14, 2005 10:54 pm

Hi.
My name of Ñàõàðîâ Ãðèãîðèé Èâàíîâè÷.
I live in Ukraine in Kharkov.
Ã

esfumato
Dragon
Posts: 264
Joined: Wed Dec 11, 2002 7:36 pm
Location: Spain
Contact:

Postby esfumato » Sun Aug 14, 2005 11:07 pm

you can take a look at http://www.python.org/

What do you have in mind to do at BOD? Which style of games do you like? could you give some titles?

Gorgon2
Whelp
Posts: 40
Joined: Wed Aug 07, 2002 5:16 pm
Location: United Kingdom

Postby Gorgon2 » Mon Aug 15, 2005 8:57 am

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by sgi1981</i>

Hi.
My name of Ñàõàðîâ Ãðèãîðèé Èâàíîâè÷.
I live in Ukraine in Kharkov. ([email protected])
Ã

sgi1981
Dragon
Posts: 61
Joined: Sun Aug 14, 2005 8:51 pm
Location: Ukraine
Contact:

Postby sgi1981 » Mon Aug 15, 2005 10:18 am

For language the Python is environment of programming with the editor of the texts of the programs and èíòåðïåðòàòîðîì?
From where I can her(it) download.

sgi1981
Dragon
Posts: 61
Joined: Sun Aug 14, 2005 8:51 pm
Location: Ukraine
Contact:

Postby sgi1981 » Mon Aug 15, 2005 10:22 am

I ask apologies, if my messages is not too legible are written, they are generated by the program - interpreter Magic Gooddy.

On a question, what style of games is pleasant to me, I can answer - to strategy.
I liked to play in Stronghold Crusader.

In BOD it is interesting to make:
1. That Person took into account a rule(situation) not only enemies, but also allies and tried to not render impacts to the allies, and took into account a structure of a map. In Blade enemies the arrangements from each other and aspiring do not take into account to render impacts to your hero, put impacts each other.
For example, if Person's is behind a lattice, through which it(he) sees you, if your hero will be is too close near them till other party of a lattice, enemy Person's will be all the same aspires you to attack and aspires to approach to you closer, how many long you would not stand on the same place, but they will attack each other.
It is understandable, that they are operated by(with) the computer, and they work on those algorithms, which are described in Scripts.
When I played in a tower Shalatuvar, there was such situation: large ORC, which at first observed of my fight, and then was lowered to kill me, has appeared from me behind a lattice and tried will come nearer to me through a lattice, in spite of the fact that through a lattice it(he) in any way will not pass. Will come nearer to me it would be possible, if it(he) would bypass a lattice and that wall, which near it(her) is. But for this purpose it was necessary to it(him) at first to depart me. When I should go under ground on same map, ORC'S has noticed me and began to try me to attack through a lattice. They were rather quick and simply have beaten each other.
More perfect SCRIPTS will make behaviour PERSON'S more perfectly.
2. There is an idea to write Script's so that each time, playing on the same level, the map differed from previous a little.
Above this idea I thought already for a long time, in spite of the fact that while poorly I know purpose(assignment) of functions Script's.
I read a subject Ñyco / An other one like Severance.
It, how has bothered to play on the same maps?
Or it, how has bothered to play by the same hero?
Or both about 1 and about 2.
I have noticed, that already has bothered to play on the same maps.
In each beginning of game of a map with the identical name identical and you know as them to pass and where that lays and it becomes not interesting again to play on the same map.
Really, ñêðèïòû each time is carried out by(with) the same concrete actions.
If any operator creates with what íèáóäü a subject, this operator will create a subject on the same place, where it(he) has created it(him) last time. And we know beforehand, where this subject will be is.
For example, ñíàäîáúå of life or force and other subjects are each time on the same place.
The opponents cost(stand) each time on the same places.
Walls same.
If WE shall analyse Script's, we shall see, that the arguments of functions of creation of objects are given as numbers (constants), instead of variable.
For example:

naginatalabyr=Bladex. CreateEntity ("Naginatalabyr", "Naginata", 19747.450129, -7972.752803,58023.800010, "Weapon")
naginatalabyr. Orientation=0.991942, -0.126433, -0.008029,0.000602
carcajlabyr1=Bladex. CreateEntity ("Carcajlabyr1", "Carcaj", 51548.294771, -6272.977772, -13225.137996, "Physic")
carcajlabyr1. Scale=1.000000
carcajlabyr1. Orientation=0.764372,0.486959, -0.356433,0.227073
o=Bladex. CreateEntity ("BloqueCan2", "Bloque", -38075.209000,1670.000000, -16190.490000)
o. Scale=2.958215
o. Orientation=0.653282,0.270598, -0.270598, -0.653282
o. CastShadows=0
o. Alpha = 0
Reference. EntitiesSelectionData [o. Name] = (0,0, " ")
o=Bladex. CreateEntity ("Resto0", "Skull", 24503.5331984, 10899.2736671, -17754.9490121, "Weapon")
o. Scale=1.220190
o. Orientation=0.80048084259, 0.567273318768, 0.18814599514, -0.0450829863548
o=Bladex. CreateEntity ("Resto25", "Piedra_01", 13536.951597,7456.414713, -23268.889793, "Physic")
o. Scale=1.000000
o. Orientation=0.987823, -0.068613,0.020817,0.138074

o=Bladex. CreateEntity ("Resto26", "Tabla_rota2", 13079.341614,3787.883368, -29356.044586, "Physic")
o. Scale=1.580459
o. Orientation=0.707213,0.111364,0.042916, 0.696854

o=Bladex. CreateEntity ("Resto27", "Piedra_09", 13245.568401,4072.007233, -29006.303911, "Physic")
o. Scale=0.827740
o. Orientation=0.704515,0.708005, -0.048436,0.006463

o=Bladex. CreateEntity ("Resto28", "Tabla_rota", 1711.822337,4895.095793, -33235.166071, "Physic")
o. Scale=1.947745
o. Orientation=0.386508,0.385103,0.591573, 0.593590

It is an example of creation by the computer of subjects in game.
It is necessary to pay attention, that the arguments - coordinate are given as constants (numbers), instead of variable, therefore subjects always at first will be is on the same places.
If to set arguments - coordinate as variable and these variable will depend on others variable, the subjects each time will be is in different places and in different orientation.
As values, on which the coordinates depend and the corners can be taken pseudo-casual values received from the generator of random numbers.
The generator of random numbers is in BLADE?
The not initialized generator of random numbers each time will give to the same sequence of numbers, because finds numbers on the same algorithm and initial number each time same. If to initialize initial number of the generator of random numbers by value from system hours, as each time the value of time of system hours will be any other business, the sequence of random numbers all time will be different. How many time we would not play on the same map - in this case arrangement of subjects and enemies will be any other business. And if to make, that the walls had in each beginning of game different rules(situations), it will be super.

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

Postby prospero » Mon Aug 15, 2005 11:43 am

Welcome sgi1981.[:D]

Good point about the random placement of objects. I have used this to vary the placement of potions in maps I have made. It uses the Python
whrandom module. Also used it to vary the weapons of enemies.

Code: Select all

o=Bladex.CreateEntity("Pot1","Pocima200",0,0,0, Reference.ObjType("Pocima200")) o.Scale=1.0 o.Orientation=(0.0,-0.986,0.0,0.0) pocimac.CreatePotion(o.Name) o=Bladex.CreateEntity("Pot2","Pocima200",0,0,0, Reference.ObjType("Pocima200")) o.Scale=1.0 o.Orientation=(0.0,-0.98,0.0,0.0) pocimac.CreatePotion(o.Name) o=Bladex.CreateEntity("Pot3","Pocima100",0,0,0, Reference.ObjType("Pocima100")) o.Scale=1.0 o.Orientation=(0.0,-0.98,0.0,-0.111) pocimac.CreatePotion(o.Name) o=Bladex.CreateEntity("Pot4","Pocima100",0,0,0, Reference.ObjType("Pocima100")) o.Scale=1.0 o.Orientation=(0.12,-0.98,0.0,-0.111) pocimac.CreatePotion(o.Name) <font color="yellow">hidpos = (1,2,3,4,5,6) idx = whrandom.randint(0, len(hidpos)-1) Pos = hidpos[idx]</font id="yellow">p1=Bladex.GetEntity("Pot1") p2=Bladex.GetEntity("Pot2") p3=Bladex.GetEntity("Pot3") p4=Bladex.GetEntity("Pot4") if Pos==1: p1.Position=563401,19124,-60697 p1.Orientation=(0.12,-0.98,-0.01,-0.11) p2.Position=564907,18595,-75265 p2.Orientation=(0.707,0.707,0.0,0.0) p3.Position=565721,18800,-85872 p3.Orientation=(0.707,0.707,0.0,0.0) p4.Position=578604,18787,-63802 p4.Orientation=(0.707,0.707,0.0,0.0) print("potions1") if Pos==2: p1.Position=590010,18622,-69223 p1.Orientation=(0.984,-0.119,-0.125,-0.020) p2.Position=605127,18793,-71448 p2.Orientation=(0.707,0.707,0.0,0.0) p3.Position=609019,9165,-68399 p3.Orientation=(0.983,-0.116,-0.134,-0.0165) p4.Position=617928,18994,-76063 p4.Orientation=(0.707,0.707,0.0,0.0) print("potions2") if Pos==3: p1.Position=607527,18787,-73171 p1.Orientation=(0.707,0.707,0.0,0.0) p2.Position=615419,23990,-53972 p2.Orientation=(0.430,0.430,0.560,-0.560) p3.Position=611395,26587,-58972 p3.Orientation=(0.707,0.707,0.0,0.0) p4.Position=605494,26590,-61046 p4.Orientation=(0.707,0.707,0.0,0.0) print("potions3") if Pos==4: p1.Position=580010,17799,-55941 p1.Orientation=(0.707,0.707,0.0,0.0) p2.Position=565835,11922,-84763 p2.Orientation=(0.92,-0.11,-0.35,-0.07) p3.Position=565001,11787,-80128 p3.Orientation=(0.70,0.70,-0.013,0.008) p4.Position=564726,11795,-73830 p4.Orientation=(0.707,0.707,0.0,0.0) print("potions4") if Pos==5: p1.Position=573645,10290,-63680 p1.Orientation=(0.707,0.707,0.0,0.0) p2.Position=567840,10587,-62474 p2.Orientation=(0.707,0.707,0.0,0.0) p3.Position=574191,18790,-67743 p3.Orientation=(0.707,0.707,0.0,0.0) p4.Position=618876,20283,-67331 p4.Orientation=(0.707,0.707,0.0,0.0) print("potions5") if Pos==6: p1.Position=628106,20428,-63918 p1.Orientation=(0.99,-0.10,0.0,0.0) p2.Position=563540,18791,-63187 p2.Orientation=(0.707,0.707,0.0,0.0) p3.Position=577147,18793,-86943 p3.Orientation=(0.707,0.707,0.0,0.0) p4.Position=618876,20283,-67331 p4.Orientation=(0.707,0.707,0.0,0.0) print("potions6")

sgi1981
Dragon
Posts: 61
Joined: Sun Aug 14, 2005 8:51 pm
Location: Ukraine
Contact:

Postby sgi1981 » Mon Aug 15, 2005 2:58 pm

Hi Gorgon2.
I have one interesting program, which I have written itself, made on Delphi.
When I for the first time played in ZARANDAUR I, did not know, where there it is necessary to go... There darkly almost everywhere...
I dreamed to make ZARANDAUR I.......... "Light". And... Has made by his(its) "light".
Want to download zarandaur.bw "light"???
It(he) -

http://dl4.rapidshare.de/files/3942510/ ... andaur.rar
(direct link)

http://rapidshare.de/files/3942510/Svet ... r.rar.html
(indirect link)

One file zarandaur.bw there contains only.
It(he) needs to be placed instead of "normal" zarandaur.bw.

The program - lighter is here

http://dl4.rapidshare.de/files/4003632/ ... daur_I.rar
(direct link)
http://rapidshare.de/files/4003632/Crac ... I.rar.html
(indirect link)

If her to copy in the catalogue of a file zarandaur.bw, the program itself will find a file.
It is possible to enter parameters of atmospheres and to press the button of acknowledgement(confirmation)
" Ã

big truck
Dragon
Posts: 103
Joined: Mon Dec 27, 2004 2:13 pm
Location: Canada
Contact:

Postby big truck » Mon Aug 15, 2005 4:01 pm

Welcome sgi1981

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">For language the Python is environment of programming with the <font color="yellow">editor of the texts </font id="yellow"> of the <font color="yellow">programs</font id="yellow"> and èíòåðïåðòàòîðîì?
From where I can her(it) download.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

You will find some good stuffs for programming in Python in these links.

http://blade-of-darkness.bigtruck-canad ... _codes.htm

http://prospero.bigtruck-canada.ca/

I hope it will help you [:)]

sgi1981
Dragon
Posts: 61
Joined: Sun Aug 14, 2005 8:51 pm
Location: Ukraine
Contact:

Postby sgi1981 » Mon Aug 15, 2005 4:32 pm

Thank to you

Ylor
Hatchling
Posts: 5
Joined: Wed Aug 10, 2005 12:24 am
Location: Sweden

Postby Ylor » Mon Aug 15, 2005 6:03 pm

Hi!

I am actually looking into the possibilities of making a really bold project that, in the unlikely event of success, will certainly bring varity to the game.

The idea is to make a "3D random map generator" (!!!). Of cours it will not be meant only for BOD, but for any 3D-game, but if I really get enough time to put the idea inot practice I will use BOD as the example game during developement.

What it will do is to:
1. Randomly generate a "map plan". For an extremely short map that could be: Goal room with the sword you're looking for, room with golem you have to defeat to enter the room, room with key to the room with the golem, start room.

2. The second is probably the most tricky. Now the program would have to generate the actual terrain. That is, draw all the rooms in a way that they can be connected, add arches, stairs, doors and other things to make them look good, add textures and so on.

3. Add objects, enemies and similar. This part would have to be done differently for each game. For BOD it would write the necessary scripts to separate script files.

4. Translate the terrain data to a map-file. For BOD it would not be a .BW file, but an .MP file, as those seem to be easiest to undestand (I'm currently investigating the format to see if I can understand how it work).

This is, however, a gigantic project that I doubt I will ever be able to finish on my own... But it would sure be great with an almost infinite number of 3D maps!

Ylor
Hatchling
Posts: 5
Joined: Wed Aug 10, 2005 12:24 am
Location: Sweden

Postby Ylor » Mon Aug 15, 2005 6:06 pm

This program would be done in C++ of course and not Python! [;)]


Return to “Severance BoD: Modding Community”

Who is online

Users browsing this forum: No registered users and 6 guests