Differences

This shows you the differences between the selected revision and the current
version of the page.


kbase:meaecode 2009/02/23 15:33 kbase:meaecode 2010/08/06 21:11 current
Line 1: Line 1:
-===== Entradas y salidas múltiples. ===== +===== Having multi entrance and exits to and from your zones =====
==== Summery ==== ==== Summery ====
-Las escenas por defecto que crea WME tienen una posición de inicio del actor cuando la escena carga. Para muchos casos esto es suficiente, pero si tenemos una localización que tiene varias entradas, necesitaremos que el actor aparezca en diferente sitio dependiendo de por donde haya entrado.+The default scene files that come with WME have set start positions for the actor as soon as the room loads. For most cases this is fine. Though in some cases you will find that you need to have different start locations in the same room.
-El primer ejemplo de esto es si tienes una gran escena principal, con cierto número de salidas que dan a distintas locaclizaciones, Si entras en esa escena desde una de las salidas/entradas, querrás que el actor aparezca junto a la puerta por la que ha entrado y no siempre en la misma posición+The prime example of this is if you have a large main room, with a number of exits all leading to different rooms. If you enter the main room from one of these doorways you want to have the actor appear near the doorway.
-Aqui tenemos un ejemplo del script de inicio de la escena que crea WME por defecto (scene_init.script).+Lets have a quick look at the default scenes_int.script file that come with WME
<code script>#include "scripts\base.inc" <code script>#include "scripts\base.inc"
-// Se inicializa la escena, se pone al actor en la posición 400,400 y mirando hacia abajo (adelante) y por ultimo se le activa para que el jugador interactue con el+// here comes the stuff which initializes the scene
actor.SkipTo(400, 400); actor.SkipTo(400, 400);
Line 46: Line 45:
}</code> }</code>
-La parte que nos interesa en este script es esta+Ok the bit we are interested in is
<code script>actor.SkipTo(400, 400); <code script>actor.SkipTo(400, 400);
actor.Direction = DI_DOWN;</code> actor.Direction = DI_DOWN;</code>
-Como ya hemos comentado en el código, se pone al actor (SkipTo)en la posición 400,400 y mirando hacia abajo (actor.Direction=DI_DOWN). Simplemente cambiando estos valores, cambias la posición y la orientación del actor cuando la escena se inicia.+What this means is as the scene is loaded it will take the actor and "SkipTo" (place) it at the cords 400, 400 and also point the actor in the DI_DOWN (Direction Down). So. by simply editing these values you can change the start position of you actor whenever the scene loads.
 +====OK... The Good Stuff====
- +Here is a layout of our scene
-====OK... Ahora un ejemplo==== +
- +
-Este va a ser nuestro mapa para seguir el ejemplo+
{{http://img262.imageshack.us/img262/7561/wmetut01ow8.png}} {{http://img262.imageshack.us/img262/7561/wmetut01ow8.png}}
-Tenemos un gran reciibidor (hallway) con una habitación a cada extremo. Si el actor va a la cocina (kitchen), cuando vuelva al recibidor queremos que aparezca al lado de la puerta de la cocina, lo mismo para la otra habitación, la sala de baile (ballroom), así que dependiendo de que habitación salga, colocaremos al actor en una posición diferente en el recibidor.+We have a long hallway and a room at each end. If you exit the kitchen, when the hallway room loads you want the actor position to look like he just left the kitchen, same for the ballroom... so depending on witch room you exit you want a different position for your actor in the hallway scene.
-Bien, para un facil entendimiento , vamos a usar el código "initial scene transition" que viene en los tutoriales, este ejmplo hace que el actor vaya hacia un objeto cuando picas en el con el ratón+Ok..... for easy sake i will use the initial scene transition code from the tutorials. This is strait from the manual tutorials that you all have done. It is the bit that uses a entity with a actor position code in it and a script to move the actor to the entity and then change scenes on a left click.
-Entonces, las entidades de las puerta de la cocina y la sala de baile tendrían el siguiente código para entrar en la habitación. En el ejemplo la sala de baile:+So.... the Kitchen and the ballroom both have this code on an entity witch you left click to enter the ballroom.
<code script>on "LeftClick" <code script>on "LeftClick"
Line 73: Line 70:
}</code> }</code>
-Bueno, esto esta claro, va hacia el objeto, normalmente una entidad que coincide con la puerta y cuando llega, cambia de escena y aparece en la nueva. +Ok... enough background....
- +
-(seguiré traduciendo :D)+
====Passing a global variable between scenes==== ====Passing a global variable between scenes====
-So lest do this.... The way it will work is that we will define a variable, witch is passed from one scene to the other. witch can then be tested in the hallway scene, thus enabling the hallway to identify witch scene the variable came from. And this is how you do it.+So let's do this.... The way it will work is that we will define a variable, which is passed from one scene to the other. Which can then be tested in the hallway scene, thus enabling the hallway to identify which scene the variable came from. And this is how you do it.
1) Change the transition code in the kitchen entity script from the default (written above) to this new code. 1) Change the transition code in the kitchen entity script from the default (written above) to this new code.
Line 117: Line 112:
==Pause and understand what has happened== ==Pause and understand what has happened==
-The scene initialisation script is loading the scene as it dose so it loads the global variable, it then uses a TEST, with the IF loop. It breaks down like this.+The scene initialization script is loading the scene as it dose so it loads the global variable, it then uses a TEST, with the IF loop. It breaks down like this.
1) First it dose a test to see if the previous scene was the kitchen scene 1) First it dose a test to see if the previous scene was the kitchen scene
2) It then dose a test to see if the global variable it has loaded is the correct one. (the variable was set as you left the kitchen zone) 2) It then dose a test to see if the global variable it has loaded is the correct one. (the variable was set as you left the kitchen zone)
-3) If those tests are true.. then it will execute the actor placement code. Witch is+3) If those tests are true.. then it will execute the actor placement code. Which is
<code script>actor.SkipTo(400, 400); <code script>actor.SkipTo(400, 400);
        actor.Direction = DI_DOWN;</code>         actor.Direction = DI_DOWN;</code>
 
kbase/meaecode.1235399632.txt.gz · Last modified: 2009/02/23 15:33 by HelLRaiseR
Recent changes RSS feed Creative Commons License Driven by DokuWiki