1
- October 12, 2024, 08:02:45 PM
- Welcome, Guest
News:
Latest WME version: WME 1.9.1 (January 1st, 2010) - download
Show Posts
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
2
Technical forum / MOVED: RPG Style Source Code to look though.
« on: January 05, 2009, 11:42:28 AM »
This topic has been moved to Scripts, plugins, utilities, goodies.
http://forum.dead-code.org/index.php?topic=3360.0
http://forum.dead-code.org/index.php?topic=3360.0
3
Technical forum / When Loading Entities thorough scripting how to you determin order?
« on: January 04, 2009, 07:34:26 AM »
If i am loading entities with a script somthign like this....
How do you determin the order they are drawn on screen. The script loaded entites seam to load behind the 3D actor.
I assume it has somthing to do with Layer.InsertEntity ... but i am not sure how to use it?
Code: WME Script
How do you determin the order they are drawn on screen. The script loaded entites seam to load behind the 3D actor.
I assume it has somthing to do with Layer.InsertEntity ... but i am not sure how to use it?
4
Technical forum / Confused about ANGELS and RADIANS (Math.Cos / Math.Sin)
« on: January 04, 2009, 04:08:58 AM »Code: WME Script
In the manul it says....
Code: WME Script
- Returns the cosine of a number
- Parameters
- Angle
- Angle in degrees
- Returns the sine of a number
- Parameters
- Angle
- Angle in degrees
I was woundering is the input value here a RADIAN or a ANGLE. It says it returns an angle in degrees, but I am not sure what format gose into it....
I "think" it is radians.. is this correct?
5
Technical forum / How can I make a sprite move from one location to another on an ARC?
« on: January 03, 2009, 05:44:04 PM »
I am trying to do somthign that seams simple but I can not get it to work.
What I am trying to do is move a sprite from one point on the screen to another and CURVE while doign it instead of movign alogn a strait line.
Any ideas on hwo to do this?
I have this code... but it returns a wonky curve... mabey it can be improved or there is another way to do this?
This code takes the X,Y of the player actor as one point to move teh sprite from and the X,Y of the spriet entity that you click on as teh XmY of where the sprite is ment to end up.
Demo Of how it is now
Source used in Demo
What I am trying to do is move a sprite from one point on the screen to another and CURVE while doign it instead of movign alogn a strait line.
Any ideas on hwo to do this?
I have this code... but it returns a wonky curve... mabey it can be improved or there is another way to do this?
Code: WME Script
This code takes the X,Y of the player actor as one point to move teh sprite from and the X,Y of the spriet entity that you click on as teh XmY of where the sprite is ment to end up.
Demo Of how it is now
Source used in Demo
6
Technical forum / Can Somone Please check my Maths are the same as my Code?
« on: January 03, 2009, 08:38:55 AM »
Hi there... I have made a complex maths thing... and I am not sure if i am translating it into WME properly as it is going all wierd but on paper it works fine when i work it out with values....
Anyway here we go... In this I have shown the MATHS version followed by how i wrote the same thign in WME....
If you can please have a look and tell me if i translated the MATHS into WME script correctly.
Thanks in Advance.
Anyway here we go... In this I have shown the MATHS version followed by how i wrote the same thign in WME....
If you can please have a look and tell me if i translated the MATHS into WME script correctly.
Thanks in Advance.
Code: WME Script
- // Lets find the X,Y of H.
- var Xh;
- var Yh;
- // Original Math:- D1 = sqrt((Xa - Xb)^2 + (Ya - Yb)^2)
- var tmpXpow1 = (Xa-Xb);
- var tmpYpow1 = (Ya-Yb);
- var tmpD1 = tmpXpow2+ tmpYpow2;
- // Original Math:- (Xm , Ym) = ((Xa + Xb) / 2 , (Ya + Yb) / 2)
- var Xm = (Xa + Xb) / 2;
- var Ym = (Ya + Yb) / 2;
- // Original Math:- g1 = (Ya - Yb) / (Xa - Xb)
- var g1 = (Ya - Yb) / (Xa - Xb);
- // Original Math:- g2 = -1 / g1
- var g2 = -1 / g1;
- // Original Math:- phi = atan(g2)
- // Original Math:- D2 = D1 * tan(K) / 2
- var D2 = D1 * tanK / 2;
- // Original Math:- (Xh , Yh) = (Xm + D2 * cos(phi), Ym + D2 * sin(phi))
- Xh = Xm + D2 * cosPHI;
- Yh = Ym + D2 * sinPHI;
- function ArcData(Xa, Ya, Xb, Yb, Xh, Yh)
- {
- /*Original Math Xc = [(Ya - Yh)(Xb^2 + Yb^2) + (Yh - Yb)(Xa^2 + Ya^2) + (Yb - Ya)(Xh^2 + Yh^2)]
- -------------------------------------------------------------------------------
- 2*[Xb*Ya + Xa*Yh + Xh*Yb - Yb*Xa - Ya*Xh - Yh*Xb] */
- var Xc = ((Ya-Yh)*(XbP+YbP)+(Yh - Yb)*(XaP+YaP)+(Yb-Ya)*(XhP + YhP)) / 2*(Xb*Ya + Xa*Yh + Xh*Yb - Yb*Xa - Ya*Xh - Yh*Xb);
- //Yc = [(Xa - Xh)(Yb^2 + Xb^2) + (Xh - Xb)(Ya^2 + Xa^2) + (Xb - Xa)(Yh^2 + Xh^2)]
- var Yc = ((Xa-Xh)*(YbP+XbP)+(Xh - Xb)*(YaP+XaP)+(Xb-Xa)*(YhP + XhP)) / 2*(Yb*Xa + Ya*Xh + Yh*Xb - Xb*Ya - Xa*Yh - Xh*Yb);
- // Original Math:- r = sqrt((Xa - Xc)^2 + (Ya - Yc)^2)
- var r1 = (Xa-Xc);
- var r2 = (Ya-Yc);
- /*Start angle = angle between horizontal and the line joining C and A = atan2(Ya - Yc, Xa - Xc)
- Finish angle = angle between horizontal and the line joining C and B = atan2(Yb - Yc, Xb - Xc) */
- var Sag1 = Ya - Yc;
- var Sag2 = Xa - Xc;
- var Eag1 = Yb - Yc;
- var Eag2 = Xb - Xc;
- /*4) any angle between the start angle and finish angle will give you a point along the arc, so you can use code like the following pseudo code to generate these points:
- for each angle theta between the start angle and finish angle do the following
- calculate the x coordinate as Xp = Xc + r * cos(theta)
- calculate the y coordinate as Yp = Yc + r * sin(theta)
- output the point on the arc as (Xp,Yp) */
- var Xp1 = Xc + R * CosAG;
- var Yp1 = Yc + R * SinAG;
- var Xp2 = Xc + R * CosAG1;
- var Yp2 = Yc + R * SinAG1;
7
Technical forum / How exactly do you load a sprite many times on screen?
« on: January 02, 2009, 01:51:50 AM »
Mabey i am to tired or somthing but i am unable to see how to load a sprite onto the screen?
All i want to do is use a script to load a single sprite many times in diffrent places on the screen...
This is the code of the left click event i am using... all it is ment to do is load button.sprite and palce it at 70,41?
All i want to do is use a script to load a single sprite many times in diffrent places on the screen...
Code: WME Script
This is the code of the left click event i am using... all it is ment to do is load button.sprite and palce it at 70,41?
8
Technical forum / Problem With sending actor.goto commands form array.
« on: December 30, 2008, 05:59:01 PM »
Hi there...
I have a number of actors stored in an array.
I am using this code to loop through the array and (just for a test) do somthing, in this case walk to a point on screen.
enemy count is the number of items in the array.
EnemysToFight = The name of the array.
Anyway the thign is it works... the actors all move one by one to the point i said to but ... I still get an error even though everything looks like it works?
Runtime error. Script 'scripts\EnemyAttackLoop.script', line 11
Call to undefined method 'GoTo'. Ignored.
I have a number of actors stored in an array.
I am using this code to loop through the array and (just for a test) do somthing, in this case walk to a point on screen.
Code: WME Script
- for (var a=enemy_count; a>=0; a = a-1)
- {
- var temp = EnemysToFight[a];
- }
enemy count is the number of items in the array.
EnemysToFight = The name of the array.
Anyway the thign is it works... the actors all move one by one to the point i said to but ... I still get an error even though everything looks like it works?
Runtime error. Script 'scripts\EnemyAttackLoop.script', line 11
Call to undefined method 'GoTo'. Ignored.
9
Technical forum / Some .X Files question (animation between files + Mesh Changing)
« on: December 27, 2008, 02:37:55 AM »
Hi...
A couple of questions about .X file use.
1)
I know that you are able to change textures on a .X file in a live scene. So for example you can put on a new shirt and the script changes the png that is loaded on the .X file and it will instantly change in front of the players eye.
I was wondering can you do this for actors themselves. As in is there a way, with out changing the scene, to have a new Actor load onto screen in the exact same position as the old one....
EG:- You are wearing Pants and a Shirt and boots. You then put on a dress. A dress needs a different 3D model to pants.
I know though scripting that you can get actor position and direction. So it shouldn't be hard to load a new actor into the correct position for when you put on the dress, but as far as I know you need to load all the actors when the scene loads. If you can load a 2nd actor file but not have it display in the scene, and then remove one and activate the other.. maybe it could be done that way..., but can it be done in front of the players eye?
If you can not get the model to change in front of the user, could you do it with say, something like the character goes behind an object (for modesty sake) to change, then when you walk back out you are seeing the new model?.. the point is can you change the model with out re-loading the scene.
Any ideas?
2)
You know how you can load different animations though separate .X files onto a main actor .X file. How exactly dose this work? I assume it simply takes the transform information on the bones and applies it to the .X file you have loaded.
Would this mean that if I had different models, that used the same rig, so all the bones are exactly the same, but use a different Skin set up on the mesh itself... would these all still be transferable?
EG:- Pants vs Dress. You could build a skeleton rig that is exactly the same that would drive both models even though they are different meshes. But the Dress would have a very different vertex weighting skin to that of the pants.... if only the transform data is shared this should not be a problem. (dose this make sense?)
Thanks in advance.
A couple of questions about .X file use.
1)
I know that you are able to change textures on a .X file in a live scene. So for example you can put on a new shirt and the script changes the png that is loaded on the .X file and it will instantly change in front of the players eye.
I was wondering can you do this for actors themselves. As in is there a way, with out changing the scene, to have a new Actor load onto screen in the exact same position as the old one....
EG:- You are wearing Pants and a Shirt and boots. You then put on a dress. A dress needs a different 3D model to pants.
I know though scripting that you can get actor position and direction. So it shouldn't be hard to load a new actor into the correct position for when you put on the dress, but as far as I know you need to load all the actors when the scene loads. If you can load a 2nd actor file but not have it display in the scene, and then remove one and activate the other.. maybe it could be done that way..., but can it be done in front of the players eye?
If you can not get the model to change in front of the user, could you do it with say, something like the character goes behind an object (for modesty sake) to change, then when you walk back out you are seeing the new model?.. the point is can you change the model with out re-loading the scene.
Any ideas?
2)
You know how you can load different animations though separate .X files onto a main actor .X file. How exactly dose this work? I assume it simply takes the transform information on the bones and applies it to the .X file you have loaded.
Would this mean that if I had different models, that used the same rig, so all the bones are exactly the same, but use a different Skin set up on the mesh itself... would these all still be transferable?
EG:- Pants vs Dress. You could build a skeleton rig that is exactly the same that would drive both models even though they are different meshes. But the Dress would have a very different vertex weighting skin to that of the pants.... if only the transform data is shared this should not be a problem. (dose this make sense?)
Thanks in advance.
10
Game design / How to write a script for a adventure game?
« on: September 11, 2008, 06:43:03 AM »
I was wondering if anyone had any tips on how to put together a script document for a adventure game. I have been trying to write one but the multi-path responses from the user, the multi-path replies from the game npc, the variations of each "use an object' type thing etc etc.. means the script is very hard to format in a way that is easy to read.
I was wounding if anyone has any advise or maybe an example on how to format one of these documents.
I was wounding if anyone has any advise or maybe an example on how to format one of these documents.
11
Game design / What makes a good adventure?
« on: July 21, 2008, 02:51:09 PM »
I am interested in opinions on some game design issues for my project. So i thought i would discuss some thing in here and see what others opinions might be. As far as I know there seams to be only a few variations in adventure games really....
Also one of the weird things about adventure games is you often, as the player, have no idea when you start. Say you live in New Orleans, but in fact you do not know where anything is so "find the location" to advance the game. I mean how many adventure games start with a toon waking up with no idea where he is, or starting in a very generic location we can all relate to like an office. Still life for example you play a cop.. but you do not know how to gather evidence at first... OH... ultravilote light will illuminate blood... why did that character forget that?
Game Death had a nice discussion a while back - http://forum.dead-code.org/index.php?topic=2540.0
I am interested in other game devices that could be used in a adventure game sertting.... as I am starting to get stuck for something a bit more interesting after 15+ years of adventures.
My game for example is using a thing we are calling reaction clicking... where set animations sequences run and the user clicks to change the "path" of the scene.. simple example... You stumble while walking across a thin bridge... while unballenced you click.. and stay up and can walk to a new zone on level 2 or fall to level one and continue from there. This is us trying somthing not new.. it has been done many times.. but not done often.
ARE there other ways to navigate a story in a adventure style game besides those listed? -
Thoughts?
- Item Combination Puzzles - (eg:- find the tape deck, find the tape, combine, listen, get the clue or a multitude of other types of "find the item and use it"
- Puzzle Mini-games - (Open the locked box by figuring out the "code / order" of pressing the buttons - or other types of puzzles say "move the jumbled images around to make a painting")
- Word Puzzles - (decode the parchment to find the clue)
- Massive story based text (Read the logs of the dead scientists to find the code to unlock the dna fridge)
- Conversations - Speak to people to unlock more of the game / find the clues
Also one of the weird things about adventure games is you often, as the player, have no idea when you start. Say you live in New Orleans, but in fact you do not know where anything is so "find the location" to advance the game. I mean how many adventure games start with a toon waking up with no idea where he is, or starting in a very generic location we can all relate to like an office. Still life for example you play a cop.. but you do not know how to gather evidence at first... OH... ultravilote light will illuminate blood... why did that character forget that?
Game Death had a nice discussion a while back - http://forum.dead-code.org/index.php?topic=2540.0
I am interested in other game devices that could be used in a adventure game sertting.... as I am starting to get stuck for something a bit more interesting after 15+ years of adventures.
My game for example is using a thing we are calling reaction clicking... where set animations sequences run and the user clicks to change the "path" of the scene.. simple example... You stumble while walking across a thin bridge... while unballenced you click.. and stay up and can walk to a new zone on level 2 or fall to level one and continue from there. This is us trying somthing not new.. it has been done many times.. but not done often.
ARE there other ways to navigate a story in a adventure style game besides those listed? -
Thoughts?
12
Technical forum / How would i go about this?
« on: June 18, 2008, 10:39:31 AM »
My limited programming skills need some help
I basically have a room that is like the hollo-deck in startrek. Where there is a object that will run a ogg file that morphs the entire room into a new room.
Anyways....
How would i go about making walking areas and clickable things that are only active when the correct background is displayed?
I basically have a room that is like the hollo-deck in startrek. Where there is a object that will run a ogg file that morphs the entire room into a new room.
Anyways....
How would i go about making walking areas and clickable things that are only active when the correct background is displayed?
13
Technical forum / Transfering Shading and Light infomation to your 3D Actor?
« on: May 10, 2008, 05:56:47 AM »
I was wondering how you guys are solving the problem of having shadows from your sets affect your 3Dactors, and how lighting colour affects them as well. I have tried using coloured regions but they turn on as soon as the model walks into them and this colours the entire model.
I have been playing with rendering my shadows as a separate pass and then using come kind of overlay trick but i can not see how to get a 2D overlay to sit on top of the 3D actor.
Anyway.. how are you guys handeling this.. and do i need to work it out i heard rumors that these issues are addressed in the new wme scene editor that is on teh cards.
I have been playing with rendering my shadows as a separate pass and then using come kind of overlay trick but i can not see how to get a 2D overlay to sit on top of the 3D actor.
Anyway.. how are you guys handeling this.. and do i need to work it out i heard rumors that these issues are addressed in the new wme scene editor that is on teh cards.
14
Technical forum / Is there a way to move a 3d actor in the Z direction (up)
« on: April 20, 2008, 12:16:17 AM »
I have been playing with a sequence where the player actor is in fact a space ship, that you are moving about on a large scrolling scene.
So far i have been using normal 2D walk path type stuff.. using forced perspective to give the illusion that you are moving freely. Still while doing this i thought i would ask if there is any way to have up and down , diagonal up etc etc for actor3D movement.. off the ground plan of your background 3ds file.
I am pretty sure you can not do this.. but thought i would ask.
So far i have been using normal 2D walk path type stuff.. using forced perspective to give the illusion that you are moving freely. Still while doing this i thought i would ask if there is any way to have up and down , diagonal up etc etc for actor3D movement.. off the ground plan of your background 3ds file.
I am pretty sure you can not do this.. but thought i would ask.
15
Technical forum / Maya Pipline solutions...
« on: April 12, 2008, 03:39:17 AM »
Hi I am not a maya user so I do not know how to go about this.
I was wondering what Maya solutions are available for .X export?
I was wondering what Maya solutions are available for .X export?