GTAMP.com

Grand Theft Auto Media Press
It is currently Tue Dec 12, 2017 11:49 pm

All times are UTC




Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Tue Feb 09, 2016 11:53 am 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 950
Location: F21B3EED
B-$hep wrote:
Its basically finished, just maybe 5 or even less commands to add.
Make supporting of #IFDEF #ENDIF (actually its supported but ignores the PC/PSX "flags").
And finally multiscript support.

NOT command needs to be figured out fully.
I worked on it last year but left it for later. Because it was a bit tricky, i was too lazy to think hard about its logic etc and i wanted to work on other things in compiler.

What's weird on the NOT command?

_________________
My GTA2 related projects:


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 9:28 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Why you ask such question?
If you know whats weird about it then inform me and others.

If you dont know whats the point?
Does it work in your decompiler?

If yes, then you should know everything about it and instead of asking like that you should post the info.
Otherwise you trying to be smart or something.

If you are so smart and NOT commands is piece of cake then go ahead and make compiler and decompiler support all these commands.

NOT command is not the point here and its not trickier than the other commands it just takes time.


Releasing the source will not help because you dont know what the hell im doing there.
Just like i dont know much what the hell you are doing in your decompiler.

I could add the IF..ENDIF and other logic to your compiler or just make mini compiler just for example DO_NOWT and all the logic statements like IF..ENDIF etc. and so you could rewrite your compiler with that info.

But i dont understand your code, where to add this and that and so on. Its hard to understand others code.

If you write your code from start to finish then only you know how everything works etc. I talking about programmers POV.

I will release source, but when its finished. Not earlier.
If you are not patient enough, sorry. And sorry to the others. But i will release source when its time.
Its not code with few hundred lines, there are thousands of code lines.

It just takes you also so much time to figure out what im doing there and then you will find ways to make it your way and i know how that will end.

Try to be patient.


I spent many many sleepless nights (slept only 5-6 hours) just to work on the compiler (because of you guys, so you could get better compiler) which you can modify later (new commands, easier syntax etc).

I know you will say that you could write that in few days what i wrote many months or even 1 year.

Go ahead write it if you want. I dont care. Thats the way i work.


You gave me great help and source. I respect that T.M and i credited you!!

But do not make some kind of king out of yourself. Respect others also and their work.
Sorry if i offended you but that was not the purpose.



I dont like people who are trying to push some others to do something or force them.

Sektor can ban me for this post, put me on moderation or whatever but life goes on. Even with(out) this stuff..

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Thu Feb 11, 2016 7:56 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 950
Location: F21B3EED
Dont take offense from such simple question which i meant to just brainstorm together about the issue with NOT commands... i didnt really read your rant, i dont want to get angry from nothing

_________________
My GTA2 related projects:


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 8:47 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1068
it makes me a bit sad reading through all this progress and then the last posts. i hope this wasnt to demotivational and you still have it on the radar. i dont want to put you under preassure or anything. it would just be a shame if it ended just before the finish line. great work!

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Sun Jul 02, 2017 7:55 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Hello.


I have been watching the GTAMP forum. But i was lazy to log in for over a year.

About compiler..


Its almost complete, there are things that dont work yet: NOT command and maybe some DOOR commands.
But everything else basically works. Multiscript support is almost OK. Its in alpha stage and turned off.
It needs a bit work and better error checking. I havent worked on it so much.

I just worked out the mechanism how it will be done.

I just dont have time or motivation atm to test it fully. Its summer time, im on vacation and hang out more with my BMW in my garage and girls.

Not so much interest in computers and coding atm.


But i can upload the latest version so you all can test it for different scripts and commands.
And report bugs and weird things (if any).


Its pretty stable with good error check.
Give me few days. I will upload it.

I REPEAT: its 99% done.


Im not home atm.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Sun Jul 02, 2017 10:41 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1068
great to hear this. take your time, to finish it. i hope you got better weather than its over here.

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Sat Oct 07, 2017 1:40 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Hello all.
I have been busy with so much things.
But i wanted to work on this thing again a bit.
There is not alot to do.
Its almost ready. I probably forgot something etc but i have notes here and there.

There are few commands that dont work atm, the ones listed below and maybe others which i forgot.
But i think 98% (if not 99) is implemented.

List of stuff that doesnt work atm:

* Multiscript (mission script) support is implemented a bit but i turned it off.
I just did mechanism to actually allow it to compile other script.
Compiler was not able to compile the multiscripts because it was not able to find any variables declared in them.
This should now work but multiscript support its not completely implemented.
I wanted to make it accept and compile the multiscripts, thats all.

* CREATE_CHAR (NOT IMPLEMENTED)
* NOT command (NOT IMPLEMENTED)
* IFDEF PC/PCX ENDIF (NOT IMPLEMENTED / IGNORED BY COMPILER)
* some other command i forgot? (LET ME KNOW)

Some commands may have problems or can be buggy. Miss2 syntax and acting is weird sometimes.
It takes time to get these "hacks" and weird things working.

I used simple script.
For some weird reason the SET command doesnt change the value in variable c1.
Is that normal or BUG??

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
// player's normal start position
PLAYER_PED shaft = ( 232.5 , 192.0 , 2.0 ) 25 0          
OBJ_DATA ph_kris_info_phone = ( 234.5 , 193.5 , 2.0 ) 270 phone

COUNTER c1 = 0
SET c1 = 22     // why it doesnt work in miss2 and in my compiler? GTA2 ignores the value? BUG???

FORWARD ans_kris_info_phone:
THREAD_TRIGGER thr_kris_info_phone = THREAD_WAIT_FOR_ANSWER_PHONE ( shaft , ph_kris_info_phone , ans_kris_info_phone: )

ans_kris_info_phone:

    DISPLAY_BRIEF ( 3728 )  //"The Yakuza brothers are dressed in blue."
       
    DISPLAY_BRIEF ( 3729 )  //"We are Yakuza. We are strong. We have no time for the Zaibatsu. We have no time for you unless you prove yourself."

RETURN


LEVELSTART
    if(c1 = 0)
        DISPLAY_BRIEF ( 2954 ) //TANKS-GIVING!
    else
        DISPLAY_BRIEF ( 2957 ) //SINK OR SWIM!
    endif
LEVELEND
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


I attached the compiler.
You can basically drop the script with .mis (for example test.mis) extension into exe and it compiles it to same directory.

Try it, test it, make some scripts, compile, report the results.


Exe is clean (exe is big because of G++ and i dont want to compress the exe, i compiled in Release mode), later i will use stripper. Its not important in alpha/beta stage. Code is very complex and it will not compile in MS Visual C++ compilers. G++ rocks!!


Report:

https://www.virustotal.com/#/file/77fce ... /detection


Attachments:
File comment: GTA2 Script Compiler 0.9a
Gta2Miss-BSHEP.zip [584.44 KiB]
Downloaded 17 times

_________________
Always wear safety glasses while programming.


Last edited by B-$hep on Sat Oct 14, 2017 5:58 pm, edited 2 times in total.
Top
 Profile  
 
PostPosted: Sat Oct 07, 2017 1:56 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
Welcome back.

Yes known bug with SET command.

Work around is SET c1 = (22 + 0)


Top
 Profile  
 
PostPosted: Sat Oct 07, 2017 2:05 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Hello Sektor.
Interesting thing.

Miss2 doesnt compile this workaround for me

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Sat Oct 07, 2017 8:13 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
That’s what happens when I post from my phone.

COUNTER c1 = 22
SET c1 = ( c1 + 0 )

Still posting from my phone but I think that’s right. You wouldn’t even need to use the SET command if c1 was always 22.


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 8:41 am 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Yes, this works fine in miss2 and in new compiler.

I wanted to try it because SET should "replace" the value in variable and assign new value to it. That's why this code.
But it seems it doesn't change this value.

But i wonder why?

I searched SET command in my folder where i keep all the scripts, there was example:

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
COUNTER target_score_reached = 0
...
IF ( ( CHECK_SCORE_GREATER ( grnplayer , 4999 ) ) AND (target_score_reached = 0 ))
    SET target_score_reached = 1
...
 
Parsed in 0.008 seconds, using GeSHi 1.0.8.10

I guess it works. Simply setting 0 to 1 and 1 to 2.
This all was in WHILE LOOP (this matters?)

EDIT: tried in simple while loop, doesn't even display anything.

EDIT2, in this example, value is changed..
Maybe it needs to be between LEVELSTART LEVELEND to work properly?

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
// player's normal start position
PLAYER_PED shaft = ( 232.5 , 192.0 , 2.0 ) 25 0          
OBJ_DATA ph_kris_info_phone = ( 234.5 , 193.5 , 2.0 ) 270 phone
COUNTER loop = 1
COUNTER c1 = 22
SET c1 = ( c1 + 0 )

FORWARD ans_kris_info_phone:
THREAD_TRIGGER thr_kris_info_phone = THREAD_WAIT_FOR_ANSWER_PHONE ( shaft , ph_kris_info_phone , ans_kris_info_phone: )

ans_kris_info_phone:

    DISPLAY_BRIEF ( 3728 )  //"The Yakuza brothers are dressed in blue."
       
    DISPLAY_BRIEF ( 3729 )  //"We are Yakuza. We are strong. We have no time for the Zaibatsu. We have no time for you unless you prove yourself."

RETURN


LEVELSTART

    set c1 = 0   // HERE it changes value to 0 without problems and the TANKS-GIVING! is shown

    if(c1 = 0)
        DISPLAY_BRIEF ( 2954 ) //TANKS-GIVING!
    else
        DISPLAY_BRIEF ( 2957 ) //SINK OR SWIM!
    endif
LEVELEND
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


Weird stuff.


EDIT3: Script compiled with miss2 and the new compiler are identical. I guess its either LEVELSTART LEVELEND that matters or its just a BUG in GTA2.

Maybe i could fix the problem by just using S = S + I formula, like miss2 does for the first equation.
Second is stored as SET COUNTER INT command.

This of course make the .scr files different (if you do any hex comparing) by one command but it wont break anything i guess and fixes the bug.
This stuff should work directly not with some weird hacks.


I can detect if SET command is between LEVELSTART LEVELEND or not and if its not, then i can replace the SET command with that: S = S + I (change variable value to new int value) or vice versa. Its very confusing atm.

Have to drink some coffee.

I will try it.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 9:45 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
lol, seriously? I thought I always tested that after LEVELSTART but you are right, SET c1 = 1 seems to work, at least in a simple script.


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 9:51 am 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Doesnt display anything:

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
// player's normal start position
PLAYER_PED shaft = ( 232.5 , 192.0 , 2.0 ) 25 0          
OBJ_DATA ph_kris_info_phone = ( 234.5 , 193.5 , 2.0 ) 270 phone
COUNTER loop = 1
COUNTER c1 = 1
SET c1 = ( c1 + 0 )

FORWARD ans_kris_info_phone:
THREAD_TRIGGER thr_kris_info_phone = THREAD_WAIT_FOR_ANSWER_PHONE ( shaft , ph_kris_info_phone , ans_kris_info_phone: )

ans_kris_info_phone:

    DISPLAY_BRIEF ( 3728 )  //"The Yakuza brothers are dressed in blue."
       
    DISPLAY_BRIEF ( 3729 )  //"We are Yakuza. We are strong. We have no time for the Zaibatsu. We have no time for you unless you prove yourself."

RETURN


LEVELSTART
    WHILE (loop = 1)
        set c1 = 0
    ENDWHILE

    if(c1 = 0)
        DISPLAY_BRIEF ( 2954 ) //TANKS-GIVING!
    else
        DISPLAY_BRIEF ( 2957 ) //SINK OR SWIM!
    endif
LEVELEND
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


have to give this a deep look, why it skips the IF..ENDIF
I dont think that is normal. Or is it?


loop var is always 1, so while loop should execute always. And it always should set the c1 value in there to 0.
I looked into debug info of this script and couldnt find anything weird. It should display brief 2954.

have to look into actual .scr file.

Either its bug or im doing something wrong.

Sektor:
Can you show simplest example how to display value of variable in GTA2?
I know you did something like this.
What flags should i check in power manager?
i use R* "updated" GTA2.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 10:15 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
Now I remember the SET bug, it wasn't a problem with SET a = 1 , it was a problem with SET a = b. This doesn't work, so you have to do SET a = (b+0).

For testing, I use ADD_SCORE to display a variable value.

ADD_SCORE (p1,-999999999)
ADD_SCORE (p1,x)

That's only good for one variable at a time, you could enable show ped/car IDs and set IDs to the variables you want. I've never used that for debugging since it's a bit overkill :P

Example of changing ped/car IDs: viewtopic.php?f=4&t=700&start=20#p9231


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 3:38 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
In what GTA2 version you used the script from this post?

viewtopic.php?p=9231#p9231

In 9.6 game executes but crashes immediately.
XP Pro

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Sun Oct 08, 2017 10:00 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
11.44, it uses some modified commands to write memory, so it won’t work on 9.6.


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 2:34 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 950
Location: F21B3EED
B-$hep wrote:
List of stuff that doesnt work atm:

* Multiscript (mission script) support is implemented a bit but i turned it off.
I just did mechanism to actually allow it to compile other script.
Compiler was not able to compile the multiscripts because it was not able to find any variables declared in them.

If i remember correctly, each mission script is an extension to the base script, and their pointers correspond to that logic, thus none of the mission script pointers can start from the first possible pointer number. Hope that helps.

B-$hep wrote:
* CREATE_GANG_CAR (NOT IMPLEMENTED)
* CREATE_CHAR (NOT IMPLEMENTED)

In my decompiler the CREATE_GANG_CAR is same as CREATE_CAR, so the only difference is the command number, which are:
Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
#define SCRCMD_CREATE_GANG_CAR1 394 // 8A01
#define SCRCMD_CREATE_GANG_CAR2 395 // 8B01
#define SCRCMD_CREATE_GANG_CAR3 396 // 8C01
#define SCRCMD_CREATE_GANG_CAR4 397 // 8D01
 
Parsed in 0.008 seconds, using GeSHi 1.0.8.10

Hope that helps.

_________________
My GTA2 related projects:


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 5:44 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
Thank you T.M.

I forgot about these pointers in mission scripts.
I think thats were i left last time and decided to implement all other commands and stuff.

Good to know about CREATE_GANG_CAR.
Probably i can just use it in CREATE_CAR and modify just the command number like you wrote.


CREATE_CHAR is not implemented just because of lazyness.
But i will finish it.


Thanks to Sektor also.
When i tried that piece of code: ADD_SCORE (p1,x)
Modified to ADD_SCORE (shaft,c1).

I noticed that after compiling with new compiler, GTA2 crashed.
I wondered why... After looking differences between miss2 .scr file and new compiler .scr file i noticed that it didnt write variable indexes into .scr file.

In other words it had bug. Also there was no error checking for parameter 1 of ADD_SCORE (p1,x).
I mean for this example there was no error checking for p1, is it even declared, etc...

Fixed the bug and all working.


Of course i mention one thing also.

There is no "smart" variable checking currently. I mean for example again: ADD_SCORE (p1,x)
p1 is assumed to be PLAYER, but compiler will also compile this if the p1 is actually for example COUNTER p1, or CAR_DATA p1

This "smart" error checking will be made later after the all things are working, like in miss2.
I have many ideas how to make it better etc. But first it must be made working fully.

Like i said before, there is not much.
Few commands to add and basically test all commands (if possible).
I know its tedious.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 7:45 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
I implemented CREATE_GANG_CAR now.
Copy/Paste basically. Later i can review it to avoid duplication. It doesnt matter atm.

Also CREATE_CAR seems to work. I had many problems with it.
But now it seems that .scr files match 100% with miss2 .scr files.

I debug a lot with hex comparing tool, to see differences. More than running GTA2 with these scripts.
I have looked into scr files so many times that i can basically tell with simple look, which command is which, whats its index etc, where is it etc.
The structure is so deep in head already. Practice?
Because of lots of messing around with these .scr files.

"BRAINHEX" tool ??? lol.


CREATE_CHAR will be next, but now i go to bed. Need to sleep and wake up early to the work.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Mon Oct 09, 2017 8:00 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
B-$hep wrote:
There is no "smart" variable checking currently. I mean for example again: ADD_SCORE (p1,x)
p1 is assumed to be PLAYER, but compiler will also compile this if the p1 is actually for example COUNTER p1, or CAR_DATA p1

This "smart" error checking will be made later after the all things are working, like in miss2.
I have many ideas how to make it better etc. But first it must be made working fully.

Like i said before, there is not much.
Few commands to add and basically test all commands (if possible).
I know its tedious.

Don’t make it too smart, a counter can contain a player address and is used that way in some of my scripts.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group