Differences

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


kbase:meaecode 2009/02/23 15:23 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==== ====OK... The Good Stuff====
Line 72: Line 71:
Ok... enough background.... Ok... enough background....
 +
====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 112: 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.1235398981.txt.gz · Last modified: 2009/02/23 15:23 by HelLRaiseR
Recent changes RSS feed Creative Commons License Driven by DokuWiki