Difference between revisions of "Ca:Inkscape"

From X-Moto
Jump to: navigation, search
m (Reverted edits by Opofefemucu (Talk) to last revision by Trullo)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[How to create smooth levels using Inkscape|English]]
+
[[How to create smooth levels using Inkscape|English]] - [[Es:Inkscape|Español]]
 
 
=Atencio: aquest software encara esta en fase de desenvolupament. =
 
=Es més una prova a llarg termini. =
 
=Si us plau, notifica els errors al IRC=
 
 
 
 
 
== Programari Requerit ==
 
 
 
* [http://www.inkscape.org/ Inkscape] (>= 0.44)
 
* [http://www.python.org/ Python] (>= 2.4)
 
* Svg2lvl converter i inkscape extension (disponible en el xmoto cvs)
 
$ cvs -z3 -d:pserver:anonymous@xmoto.cvs.sourceforge.net:/cvsroot/xmoto co -P xmoto/tools/svg2lvl/
 
 
 
== Primer de tot ==
 
 
 
Has de instal·lar l'extensio svg2lvl del inkscape.
 
 
 
=== GNU/Linux ===
 
 
 
$ cd the_rep_where_you_ve_done_the_cvs_checkout
 
$ cd xmoto/tools/svg2lvl/
 
$ mkdir -p ~/.inkscape/extensions/svg2lvl/
 
$ cp svg2lvl.inx ~/.inkscape/extensions/
 
$ cp *.py ~/.inkscape/extensions/svg2lvl/
 
 
 
Aleshores, ja pots arrencar inkscape.
 
 
 
=== Windows ===
 
 
 
En share/extensions/ dins del directori d'instalacio de linkscape. Crea un directori anomenat ''svg2lvl''. Copia els arxius .py dins d'aquet. I copia els .inx file en share/extensions/
 
 
 
Ara, arrenca inkscape.
 
 
 
== Dibuixa un nivell ==
 
 
 
Obre Inkscape.
 
 
 
[[Image:inkscape-empty.png]]
 
  
 
----
 
----
  
Ja estas preparat per a dibuixar un nivell utilitzant Inskcape. Mira't els howto's del Inskcape del menu Ajuda.
+
'''Atenció: aquest programa encara esta en desenvolupament.'''
 
+
'''Si us plau, notifica els errors al IRC.'''
[[Image:inskcape-drawn.png]]
 
 
 
== Transforma tots els objectes en trajectories ==
 
 
 
Inskcape treballa amb les seves propies figures com estrelles, cercles, ... aixi que hauras de transormar-les en trajectories de vertex.
 
Important: no especificar les propietats d'un objecte abans de transformar-lo en trajectories ! Totes les propietats s'eliminaran.. Inkscape les borra.
 
 
 
Primer, selecciona un objecte,
 
[[Image:inskcape-obj.png]]
 
  
 
----
 
----
  
Despres, Shift+Ctrl+C (o utilitza el menu)
+
=Versions Svg2lvl=
 
 
[[Image:inskcape-obj2path.png]]
 
 
 
----
 
 
 
I ja tens la trajectoria del vertex
 
 
 
[[Image:inskcape-path.png]]
 
 
 
Repeteix aquest process per a totes les figures del inskcape (cuadrat, cercle, estrella, ...)
 
 
 
== Level objects properties ==
 
 
 
Un cop hagis dibuixat el nivell, hauras de posar les propietas dels titulars, els blocs i les figures. Selecciona un objecte, fes click dret i selecciona 'object properties'.
 
 
 
[[Image:inskcape-properties.png]]
 
 
 
----
 
 
 
Les propietats es poden dinsla caixa 'label'. Es separen amb un '|'. Si no hi han propietats especificades, l'objecte es coloca com un bloc amb la textura per defecte.
 
Tambe pots emplenar la caixa 'id', es util si escrius un script amb codi lua per al nivell, perque aixi tens els noms dels blocs, les zones, etc.. per fer-los servir en el teu script.
 
 
 
Atenció :les propietats son sensibles a les majuscules ! Escriu-les exactament com us mostrem:
 
 
 
===Propietats de Blocs===
 
* background
 
* dynamic
 
* usetexture=texture_name
 
 
 
====Exemples====
 
 
 
A background block (it's a block in the background and the player can't interact with it) using the Dark Dirt texture:
 
 
 
background|usetexture=DarkDirt
 
 
 
A dynamic block using the default texture:
 
 
 
dynamic
 
 
 
A block using the default texture:
 
 
 
(you have nothing to put in, let it blank (or let what inkscape puts in it))
 
 
 
A block using the Dark Dirt texture:
 
 
 
usetexture=DarkDirt
 
 
 
===Entity properties===
 
* typeid=[PlayerStart|EndOfLevel|Strawberry|Wrecker|ParticleSource|Sprite]
 
* size=float_number (the entity colision radius)
 
* param_name=param_value available params name are (there's more of them):
 
**z    (for Sprite)
 
**name  (for Sprite)
 
**style (for every entity)
 
**type  (for ParticleSource)
 
 
 
====For example====
 
 
 
A particle source throwing smoke:
 
 
 
typeid=ParticleSource|type=Smoke
 
 
 
A strawberry:
 
 
 
typeid=Strawberry
 
 
 
A tree sprite put under foreground blocks
 
 
 
typeid=Sprite|name=Tree1|z=-1
 
 
 
Player start:
 
 
 
typeid=PlayerStart
 
 
 
End of level:
 
 
 
typeid=EndOfLevel
 
 
 
===Zone properties===
 
*typeid=Zone
 
 
 
;The only possible value for a zone: typeid=Zone
 
 
 
== Generate level file ==
 
 
 
Inkscape works with bezier curves, but the converter only use vertex, so you have to smooth objects.
 
 
 
Select the first tool (pressing F1), then select every objects with Ctrl-a. In order to add plenty of vertex to the objects, use the Effect 'add nodes' which is available from the ''Effect'' -> ''Path modification'' -> ''add nodes'' menu. Choose a maximum lenght value of 10.0 for example.
 
 
 
[[Image:inskcape-smooth.png]]
 
 
 
 
 
Feel free to add plenty of vertex because the converter will remove unnecessary vertex. For example, here are the remaining vertex in the sample level:
 
 
 
[[Image:Sample-level-editor.png|level in the editor]]
 
 
 
 
 
===launch the converter===
 
 
 
In order to save your level in the .lvl file format, use the menu ''File -> Save as...'' (or use Shift-Ctrl-S) and choose the ''X-Moto Level'' file extension, put the level file name then press ''Save''.
 
 
 
[[Image:Save-as.png]]
 
 
 
A new window pops, you have to put:
 
 
 
* level width : the level width in xmoto unit. play with it until you find the right value for your level
 
* smoothitude : the higher the value, the smoothest the level. But don't add to much vertex, because xmoto doesn't scale very well with big levels made with thousands of vertex... and became quite slow...
 
* lua script  : the absolute path to your lua script (leave blank if your level doesn't have a lua script)
 
* level id    : the level id (each level got a unique one)
 
 
 
Then your level file will be save in the place you choose in the ''Save as...'' window.
 
 
 
[[Image:Script-params.png]]
 
 
 
 
 
You can also use the command line.
 
 
 
$ python svg2lvl.py --width=100.0 --smooth=95.0 --lua= --name=myLevelId svgfile > levelfile.lvl
 
  
Params are:
+
Utilitza la documentació apropiada per a la teva versió de svg2lvl
* level width in xmoto unit
 
* smooth percent (play with it)
 
* absolute path to lua script file (optional)
 
* level id
 
* absolute path to the svg file
 
  
Then, put your lvl generated file into your xmoto Levels directory, and you can play it:
+
* [[Ca:Inkscape-0.2.0| Antiga versió (0.2.0)]]
 +
* [[Ca:Inkscape-0.3.0| Nova versió (0.3.0)]]
 +
* [[Ca:Inkscape-dev|Versió de desenvolupament]]
  
[[Image:sample-level.jpg|thumb|Our level in X-Moto]]
+
=Petita Descripció=
  
=== Arxius utilitzats en aquesta guia===
+
Svg2lvl es el nou editor de nivells de l'X-Moto. Utilitza [http://www.inkscape.org Inkscape] per dibuixar els nivells, aleshores et permet desar el teu dibuix com un nivell de l'X-Moto (arxiu .lvl). També permet editar les propietats del nivell amb l'[http://www.inkscape.org Inkscape] com per fer un bloc de fons, maduixes, ...
  
*svg: [[Media:sample.svg]]
+
Svg2lvl esta escrit en [http://www.python.org/ Python], es una extensió de l'[http://www.inkscape.org Inkscape].
*lvl: [[Media:sample.lvl]]
 

Latest revision as of 11:23, 26 November 2010

English - Español


Atenció: aquest programa encara esta en desenvolupament. Si us plau, notifica els errors al IRC.


Versions Svg2lvl

Utilitza la documentació apropiada per a la teva versió de svg2lvl

Petita Descripció

Svg2lvl es el nou editor de nivells de l'X-Moto. Utilitza Inkscape per dibuixar els nivells, aleshores et permet desar el teu dibuix com un nivell de l'X-Moto (arxiu .lvl). També permet editar les propietats del nivell amb l'Inkscape com per fer un bloc de fons, maduixes, ...

Svg2lvl esta escrit en Python, es una extensió de l'Inkscape.