IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (3) 1 [2] 3   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 cleo file structure

 
fastman92  
Posted: Sunday, Apr 29 2012, 12:16
Quote Post


фастман92 | ف
Group Icon
Group: Members
Joined: Jul 28, 2009

pl.gif

XXXXX



3F A0 00 00

You put value being read as 0x0000A03F = 0xA03F when integer.
00 00 A0 3F isn't equal to 3F A0 00 00.
Users WebsitePMMSN
  Top
 

 
Wesser  
Posted: Sunday, Apr 29 2012, 16:05
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Seriously, leave it. You're asking help for basic things. confused.gif
PMMSNPlayStation Network
  Top
 

 
Bad.boy!  
Posted: Monday, Apr 30 2012, 10:55
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



I am quiet stubborn*, and continue working on this compiler.

Does anyone know how high a number must be to use 8bit, 16bit or 32bit ints? What is the highest value 8, 16 and 32bit can handle?

*Google translate, don't know if it's the word I mean
PM
  Top
 

 
fastman92  
Posted: Monday, Apr 30 2012, 11:59
Quote Post


фастман92 | ف
Group Icon
Group: Members
Joined: Jul 28, 2009

pl.gif

XXXXX



QUOTE (Bad.boy! @ Monday, Apr 30 2012, 11:55)
I am quiet stubborn*, and continue working on this compiler.

Does anyone know how high a number must be to use 8bit, 16bit or 32bit ints? What is the highest value 8, 16 and 32bit can handle?

*Google translate, don't know if it's the word I mean

Calculate it yourself
2^8 - 1 = ?
2^16 -1 = ?
2^32 -1 = ?

^ is power sign. For example 2 ^ 3 = 2*2*2 = 8

Look in Google what is binary system 10101011111010101010110100101

Seriously, leave it.
Users WebsitePMMSN
  Top
 

 
Deji  
Posted: Monday, Apr 30 2012, 17:58
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



Well, personally I like to encourage all attempts to gain a greater understanding of something through practical work. Bad.boy could just do with learning to do more of his own research. But in fairness, this stuff should be pretty well documented by now, but it isn't.

As Wesser said, though, this article has enough information to get you well on your way (though parts are pretty badly written and demonstrated, but I guess most of it was written years ago).
Users WebsitePM
  Top
 

 
Bad.boy!  
Posted: Tuesday, May 1 2012, 21:01
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



I continued working on the compiler (with no decompiling functions). And I made some progress.

From this:
EDIT: This didn't really work

Ohh and I aint that bad in C# (not good either), it's just that I never done anything with hex and binary's.

This post has been edited by Bad.boy! on Wednesday, May 2 2012, 20:01
PM
  Top
 

 
Wesser  
Posted: Wednesday, May 2 2012, 07:20
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




You must analyze the source code first. You cannot create any scripts without a theorical face. For example, R* didn't implement a REPEAT-UNTIL statement, which is what you've done now (they probably found either some conflicts with FOR loop composition or its futility). My decompiler (which follows R*'s standards) won't decompile your code correctly then.
PMMSNPlayStation Network
  Top
 

 
Bad.boy!  
Posted: Wednesday, May 2 2012, 10:43
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



They made a repeat until loop, but R* code jumps to an other label and jumps back (I think):
CODE
  WHILE NOT HAS_MODEL_LOADED counter_create_car
   
   WAIT 0
   
   PRINT_NOW LOADCAR 100 1 //"Loading vehicle, press pad2 leftshoulder1 to cancel"
   
   IF IS_BUTTON_PRESSED PAD2 LEFTSHOULDER1
    //++ counter_create_car
    GOTO next_carzzz
   ENDIF
 
  ENDWHILE


So I should make an other label and then jump back?

EDIT: New Code
CODE
public static void OpcodeWhile(string lijn, int index, bool flag)
       {
           if (flag == false)
           {
               Main.index--;
               index--;
               int index5 = 0;

               for (int i = index; i > 0; i--)
               {
                   if (Main.Script[i] != null)
                   {
                       int Temp = Main.Script[i].Length;
                       Temp /= 2;
                       index5 += Temp;
                   }
               }

               index5 *= -1;
               string Hex3 = "4D00" + Variables.Signed32BitInt(index5);

               bool isNot = false;
               int index2 = 0;
               string Opcode = "";
               string[] opcode = lijn.Split(new Char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

               if (!lijn.Contains("NOT"))
               {
                   foreach (string woord in opcode)
                   {
                       index2++;
                       if (index2 == 2)
                       {
                           Opcode += woord;
                       }

                       if (index2 == 3)
                       {
                           Opcode += " " + woord;
                       }
                   }
               }
               else
               {
                   isNot = true;
                   foreach (string woord in opcode)
                   {
                       index2++;
                       if (index2 == 3)
                       {
                           Opcode += woord;
                       }

                       if (index2 == 4)
                       {
                           Opcode += " " + woord;
                       }
                   }
               }

               int index4 = 0;
               foreach (string ding in Main.While)
               {
                   if (ding != null)
                   {
                       if (ding.Length > 1)
                       {
                           index4++;
                       }
                   }
               }

               Main.FindOpcode(Opcode, index, true);
               string Hex = "";
               
               if (isNot == true)
               {
                   int index3 = 0;
                   string[] Tempvar = Regex.Split(Main.While[index4], "");

                   foreach (string nummer in Tempvar)
                   {
                       index3++;
                       if (index3 == 4)
                       {
                           Hex += "8";
                       }
                       else
                       {
                           Hex += nummer;
                       }
                   }
               }
               else
               {
                   Hex = Main.While[index4];
               }

               Main.While[index4] = Hex + Hex3;
               Main.CurrentWhile[index4] = "Huidige";
           }
           else
           {
               Main.Error = true;
           }
       }
           
       public static void OpcodeEndWhile(string lijn, int index, bool flag)
       {
           if (flag == false)
           {
               int i = -1;

               foreach (string line in Main.CurrentWhile)
               {
                   if (line != null)
                   {
                       if (line == "Huidige")
                       {
                           i++;
                       }
                   }
               }

               string Hex = Main.While[i];
               Main.CurrentWhile[i] = null;
               Main.Script[index] = Hex;
               Main.index++;
           }
           else
           {
               Main.Error = true;
           }
       }



This post has been edited by Bad.boy! on Thursday, May 3 2012, 08:10
PM
  Top
 

 
Wesser  
Posted: Wednesday, May 2 2012, 11:58
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Listen, I have good knowledges about the source code, so it'd be useless for you to understand by yourself what another user already knows. Wait some time till my documentation will come up. smile.gif
PMMSNPlayStation Network
  Top
 

 
Bad.boy!  
Posted: Saturday, May 5 2012, 20:53
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



If anyone is interested: I've finished the while loop, and added an if loop.
CODE
THREAD "HIGH" // <-- Bug

IF IS_PLAYER_PLAYING PLAYER
   IF IS_PLAYER_PLAYING PLAYER2<155>
       WAIT 100
   ELSE
       WAIT 200 // <-- Bug
   ENDIF

   WAIT 300
ENDIF

END_CUSTOM_THREAD

CODE
{$CLEO .cs}

//-------------MAIN---------------
if
  Player.Defined($PLAYER_CHAR)
else_jump @NONAME_52
if
  Player.Defined($SECOND_PLAYER)
else_jump @NONAME_43
wait 100
jump @NONAME_47

:NONAME_43
wait -56 // Bug

:NONAME_47
wait 300

:NONAME_52
0A93: end_custom_thread


The if with while doesn't seem to compile good, but I'm sure that it is fixable.

This is a generated code, it's not programmed to compile only that combination
PM
  Top
 

 
Deji  
Posted: Sunday, May 6 2012, 02:00
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



'THREAD' isn't the native-y name for that. In pure SCR coding, a thread only occurs on sweaters.
Users WebsitePM
  Top
 

 
Bad.boy!  
Posted: Sunday, May 6 2012, 08:14
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



QUOTE (Deji @ Sunday, May 6 2012, 04:00)
'THREAD' isn't the native-y name for that. In pure SCR coding, a thread only occurs on sweaters.

That fixes the thread bug, it's SCRIPT_NAME in my compiler

EDIT:
Also fixed the wrong int bug, my compiler didn't switch from 8bit to 16bit int.


EDIT2: It's alive!
CODE
SCRIPT_NAME "WHILE"

WHILE IS_PLAYER_PLAYING PLAYER
   WAIT 0
GET_CHAR_HEALTH PLAYER_CHAR health

IF health < 150i
 health += 5i
 IF health > 150i
  health = 150i
 ENDIF
 
 SET_CHAR_HEALTH PLAYER health
ENDIF
ENDWHILE

CODE
{$CLEO .cs}

//-------------MAIN---------------
thread "WHILE"

:WHILE_9
wait 0
0@ = Actor.Health($PLAYER_ACTOR)
if
  not 0@ >= 150
else_jump @WHILE_82
0@ += 5
if
 0@ > 150
else_jump @WHILE_74
0@ = 150

:WHILE_74
Actor.Health($PLAYER_CHAR) = 0@

:WHILE_82
  Player.Defined($PLAYER_CHAR)
else_jump @WHILE_9


I still have to add labels and jumps, and then add more opcodes.

This post has been edited by Bad.boy! on Sunday, May 6 2012, 12:18
PM
  Top
 

 
Bad.boy!  
Posted: Wednesday, May 9 2012, 15:55
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



Opcodes that uses integers can use float too, right?

Like
wait 100000000000000 = wait 100000000000000.0 (float)

Don't know why someone wants to use numbers higher than 32bit ints. But I'll make it just in case.

I've finished the GOTO opcode. Next up is gosub (easier version of goto, should be done quickly).
PM
  Top
 

 
Link2012  
Posted: Wednesday, May 9 2012, 15:58
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



But the game will not read this right, the game expects a integer in wait.
PMMSN
  Top
 

 
Deji  
Posted: Thursday, May 10 2012, 08:51
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



The game will handle a float value just fine. The game reads floats and integer with the same function, which reads the data type and decides how to read the value.
Users WebsitePM
  Top
 

 
Link2012  
Posted: Thursday, May 10 2012, 15:46
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



Maybe you didn't understand what I mean...
Yes, the game will read the float fine, but will not send the correct (in integer) value to CScriptThread::wakeTime.

The game will read the float, and will not do any kind of conversion to integer, since wait is expecting a integer, will not go right.

so
wait 1.0
will be like doing
wait 1065353216

I know that the float and integer is get in the same function (CScriptThread::getNumberParams).
Did you understood what I mean?

This post has been edited by Link2012 on Thursday, May 10 2012, 15:50
PMMSN
  Top
 

 
Deji  
Posted: Thursday, May 10 2012, 20:04
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



I knew that, but its not really a reason for the compiler to not support using floats in place of integers. Also I dont get why you're having to add these opcodes individually. Something like an xml file with opcode information should be the only thing that has to be changed per-opcode.
Users WebsitePM
  Top
 

 
Bad.boy!  
Posted: Thursday, May 10 2012, 20:34
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



I'll leave the float instead of int. I didn't want to use numbers that high anyway.

QUOTE
Also I dont get why you're having to add these opcodes individually. Something like an xml file with opcode information should be the only thing that has to be changed per-opcode.

I wanted to add opcodes in a xml or something, but I skipped it and added a few opcodes to test the compiler.

I've still got loads of work to do. I've recently discovered some bugs with "GOTO", I have to make the opcode list, make something to tell the user what they did wrong instead of a crash, the design of the program and maybe a popup menu in the textbox which shows opcodes, like visual studio does.

And if I get everything to work maybe improving the calculating part, now you have to end the senctence with i(nt) or f(loat).
PM
  Top
 

 
Link2012  
Posted: Thursday, May 10 2012, 20:47
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



QUOTE (Deji @ Thursday, May 10 2012, 17:04)
I knew that, but its not really a reason for the compiler to not support using floats in place of integers. Also I dont get why you're having to add these opcodes individually. Something like an xml file with opcode information should be the only thing that has to be changed per-opcode.

I understood his question as something like "If I put a float in WAIT the game will read good as a INTEGER?"
PMMSN
  Top
 

 
Bad.boy!  
Posted: Thursday, May 10 2012, 21:08
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



That was my question, I was wondering because Sanny Builder converts ints that are higher than 32bit int to float.
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (3) 1 [2] 3 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG