Mod

Started by matt, Sun 28/12/2008 06:54:53

Previous topic - Next topic

matt

Mod
Mod is a 3d first person game i have started woking on. i am an ok scripter and the 3d/walking script is finished except for the constant bugs i would like some help if possible.
i am also a no use artist so any one in that field would like to help come on.

for the script the 3d script is:

if (PRoom != 0) { // if players room is not equal to 0
  RawDrawImage(Player_Facingx-200, Player_Facingy-150, 7);// Print the background
  File *input = File.Open(String.Format("%d.rom", PRoom), eFileRead);// open the room file
  if (input != null) {
   while (!input.EOF) {
     String line = input.ReadRawLineBack();
     String stew = line.Substring(6, 4);//object pos east west
     String stns = line.Substring(10, 4);//object pos north south
     String stud = line.Substring(14, 4);// object y pos
     String std = line.Substring(18, 4);// size
     int size_of_the_object = std.AsInt; // size as int
     int in5 = Player_Facingx; // player facing degrees named differently
     int in6 = Player_Facingy; // player facing degrees named differently
     int inox = 123; // objects east, west  pos on map(would usaully be 'int inox = stns.AsInt')
     int inoy = 1; // same as above except for it is the objects up/down pos on the map
     int inoz = 123; // same as above except fo it is the objects north, south pos on the map
     int insupportx = inox-Player_PosEW; // objects ew pos - Players ew pos
     int insupportz = inoz-Player_PosNS; // objects ns pos - Players ns pos
     int insupporty = inoy-Player_PosY; // objects ud pos - Players ud pos
     float fl1 = IntToFloat(insupportx);
     float fl2 = IntToFloat(insupportz);
     float fl51 = IntToFloat(insupporty);
     float fl3 = Maths.ArcTan2(fl1, fl2);
     float fl4 = Maths.RadiansToDegrees(fl3);
     float fl32 = Maths.ArcTan2(fl1, fl51);
     float fl61 = Maths.RadiansToDegrees(fl32);
     int in7 = FloatToInt(fl4);
     int in71 = FloatToInt(fl61);
     if (in7 < in5+200) {
       if (in7 > in5-200) {
         if (in71 < in5+200) {
           if (in71 > in5-200) {
             int insupportx1 = Player_PosEW-inox;
             int insupportz1 = Player_PosNS-inoz;
             int insupporty1 = Player_PosY-inoy;
             float fl5 = IntToFloat(insupportx1);
             float fl6 = IntToFloat(insupporty1);
             float fl8 = Maths.RadiansToDegrees(fl3);
             int in8 = FloatToInt(fl8);
             float fl7 = Maths.ArcTan2(fl2, fl1);
             int support2 = insupportx1*insupportx1;
             int support3 = insupporty1*insupporty1;
             int support31 = insupportz1*insupportz1;
             int support4 = support31+support3+support2;
             float support51 = Maths.Sqrt(IntToFloat(support4));
             int distance = FloatToInt(support51);
             String st1 = "";
             int in9 = 0;
             st1 = line.Substring(0, 4);
             if (line.Contains("tree")!= -1) {
               in9 = 8;
               st1 = "tree";
             }
             String st3 = String.Format("%s%04d.bmp", st1, in8);
             DynamicSprite* ds = DynamicSprite.CreateFromFile(st3);
             String st4 = "";
             String st5 = "";
             
             if (ds != null) {
               int int1 = ds.Height;
               int int2 = ds.Width;
               distance = distance/90;
               distance++;
               size_of_the_object++;
               int help1 = (int1/distance)*size_of_the_object;
               int help2 = (int2/distance)*size_of_the_object;
               if (help1 != 0) {
                 if (help2 != 0) {
                   RawDrawImageResized(in5-in7, in6-in71, ds.Graphic, help1, help2);
                 }
               }
               debug.Text = String.Format("distance %d, help1 = %d, help2 = %d, width = %d, height = %d, size of the object = %d", distance, help1, help2, int1, int2, size_of_the_object);
               ds.Delete();
            }
          }
        }
      }
    }
  }
  input.Close();
  }

in pics


post either to join the team or with a better script



thanks


matt

what?

Trent R

Well, I'd suggest player.Room instead of PRoom variable.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

m0ds

What exactly are you saying? And why are you using my name? Blasphemy!

matt

Quote from: Mods on Sun 28/12/2008 19:58:21
And why are you using my name? Blasphemy!
sorry, i didn't realise that there was someone called mod and the game is a mod of another game i started a few months ago.

what?

Ryan Timothy B

Quote from: Mods on Sun 28/12/2008 19:58:21
What exactly are you saying? And why are you using my name? Blasphemy!

Looks like you'll have to bring the Zero back into your name, Mods.

ManicMatt

I must admit for a second there I was expecting a thread about Mods, the person. But I suppose thats like calling myself "Demo".. ooh that'd be fun. And confusing.

"Ask demo" "What demo?"

matt

can we please get back to the topic

what?

DeviantGent

But topic deviations are fun and profitable! I believe it to be the mythological second step, illustrated in the following formula:

Stage 1 - Create topic.

Stage 2 - Deviate from above topic.

Stage 3 - PROFIT.
The Deviant Gent
His Tumblr - His Twitter

matt


what?

DeviantGent

Im sorry, I cant hear you over the SOUND OF ALL MY PROFIT.
The Deviant Gent
His Tumblr - His Twitter

Layabout

You gunna share that profit, or are we gunna have to make you?
I am Jean-Pierre.

Ghost

Quote from: matt on Mon 29/12/2008 00:09:54
can we please get back to the topic

Some further info and/or some screenshots of your game so far would help a lot; I admit that I'd feel more inclined to read through all that code with some VISUALS about what it does. You know what it does. All we can do is guess.

bicilotti

Quote from: Ghost on Mon 29/12/2008 02:04:08
Quote from: matt on Mon 29/12/2008 00:09:54
can we please get back to the topic

Some further info and/or some screenshots of your game so far would help a lot; I admit that I'd feel more inclined to read through all that code with some VISUALS about what it does. You know what it does. All we can do is guess.

Indeed. Post a screenie, tell us exactly what the bugs are or, even better, upload an .exe.


DeviantGent

Quote from: The Invincible Cardboard Urinal on Mon 29/12/2008 01:37:44
You gunna share that profit, or are we gunna have to make you?

YOU'LL NEVER TAKE ME ALIVE G MAN.
The Deviant Gent
His Tumblr - His Twitter

Ryan Timothy B

I have no idea what is going on with that code..  And to make things easier on yourself and others, you should definitely think about typing a little description for each variable you declare, etc.  Like:
Code: ags

int inoy = 1; //this is the integer telling me where the toilet paper roll is


One thing I did notice.  You have declared over 45 variables.  Some of them you are even declaring as a "0" or "".  I'm not the wisest AGS user, but once you declare a variable, isn't it automatically nothing?  Null?

matt

i have up dated it with some visuals and more //'s

what?

Gilbert

Quote from: Mods on Sun 28/12/2008 19:58:21
What exactly are you saying? And why are you using my name? Blasphemy!

No no no... He's only using part of you. Remember, you are plural!

bicilotti

Quote from: matt on Mon 29/12/2008 04:07:30
i have up dated it with some visuals and more //'s

Have you?

matt

sorry i had to go

what?

bicilotti

Quote from: matt on Mon 29/12/2008 07:29:52
sorry i had to go

You made me cry / are a bad person.

SMF spam blocked by CleanTalk