Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Spooky

[SRC|REL] SCM Hook for Vice City

Recommended Posts

Spooky

Hiya,

 

I've had this code done for a while now, but never got round to releasing it. The few people I've given it to found it more helpful than the DirectX Hook/SCM Hook combined, and so.. here it is.

 

http://spookie.powerpill.co.uk/scmmod/

 

The code should allow you to make missions in C++, although alot of the functions might need adding to the script classes (you'll see what I mean when you get it wink.gif). Doing this allows you to write mission code in the format of...

 

pSwatVan->GetRelativeCoordinates(-8.0, 30.0, 3.0, &fX, &fY, &fZ);pGame->SetCameraPosition(fX, fY, fZ, 0.0f, 0.0f, 0.0f);pGame->SetCameraOnVehicle(pSwatVan->GetVehicle());pGame->SetWidescreen(true);SCRIPT_WAIT(1000);pGame->Fade(1000, FADE_IN);while (pGame->Fading()) SCRIPT_WAIT(0);pGame->TextNow("!CAUGHT", 4000, 1);

 

...which would set the camera relative to the swat van vehicle, point the camera at the swat van, wait a second, fade in for 1 second and then display the "!CAUGHT" text for 4 seconds.

 

The last command in the above sample code, pGame->TextNow, displays text from a GXT entry, but with the included GXT hook, you can add your own "fake" gxt entries (prefixed with an exclamation mark) as I have done with "!CAUGHT"...

 

spookie_dot_gxt GxtEntries[] ={"",  	L"NOT FOUND","!CAUGHT",	L"The feds have picked up Phil and Hilary for questioning!"};

(from GXTHook.cpp)

 

Anyway, I'm going to cut this post here, as I'm sure that I am rambing on (it was a long night last night tounge.gif)

 

Have fun with it, and Happy New Year!

Share this post


Link to post
Share on other sites
Kryptos

Since no one else has said this yet, I suppose it only appropriate that it be me. Spookie, it's great to see a guy like you here, in this community. It's people like you who are constantly making the required advancements that thrust new oppurtunities into the plates of the laymen. Thanks for this new offering, it won't go unappreciated.

Share this post


Link to post
Share on other sites
steve-m
hehe, I think nobody has replied yet because they are still lying dead on the floor after seeing this... biggrin.gif

Share this post


Link to post
Share on other sites
Kryptos

...or dead on the floor after New Years. I was going to reply yesterday, nearly immediately after reading this, but in my drunken state I feared both that this was a topic which didn't require replies, and also that my words would fall in a seemingly confusing fashion.

Share this post


Link to post
Share on other sites
Squiddy

Told you before Spookie, it's great to have you here. This is another really great contribution. inlove.gif

Share this post


Link to post
Share on other sites
steve-m

Amazing work Spooky!

 

At a first glance it seems quite easy to convert it to Delphi, what makes it interesting... wink.gif

Share this post


Link to post
Share on other sites
Barton Waterduck

Yes, and it would be even greater if:

1. People use it.

2. Release their mission coding work using it (since the mods released using tools like this since the first one (like it) came out for gta 3 has been less than 2 (that I can remeber anyway)). confused.gif

 

And I have a feeling that the more advanced mission script editors that will be coming out for the PC version of GTA SA using C like structured codes will be just as "popular". I hope I'm wrong though. Seriously. Not trying to start another flame war. dozingoff.gif Since this post could get people pissed anyway, I just want to "end" with that I would like to see another BASIC like mission script editor since BASIC is EASY (or should be). Like a real professional BASIC compiler supporting C like functions, subs, object oriented programming, using functions in functions, like

set_car_color get_actor_car(player_actor), get_car_color1(get_actor_car(player_actor)), 2

 

Simple code without any useless "{" symbols or any C thingies like it.

Edited by Barton Waterduck

Share this post


Link to post
Share on other sites
Y_Less

I didn't reply because I assumed the topic was locked (don't know why confused.gif ).

 

Anyway, this looks really great, does it have a list of its own commands? and if so, where are they (i.e. all the opcodes in this format).

Share this post


Link to post
Share on other sites
Squiddy

At the end of gamescripting.h you find all used opcodes, just like it was in the 'old' scm hook.

In scriptclasses.h all avaiable commands for game, player etc. are declared and implemented in scriptclasses.cpp.

 

Or what do you mean?

Share this post


Link to post
Share on other sites
Y_Less

No, that is what I meant, but do the rest need adding to it for the compile to work.

 

i.e. if I wanted to use 0506, would I have to add the line:

 

 

const SCRIPT_COMMAND set_car_variation  = { 0x0506, "vii" };	// (CAR_*), variant, variant

 

Share this post


Link to post
Share on other sites
gadfly

I have not been by these forums in months, I did alot of mission coding never released to anyone but friends and I using gtama. I liked their tool. but being a C coder I am absolutely thrilled at this new development.

 

Unlike some people who are constantly moaning, there are some of us that love C. C really has a great syntax and style, half the languages borrow its syntax,java, javascript, php .... . The old way of mission coding at times was so hacked. Just doing simple loops or comparisions was hackish. Now we have goool ole C.

 

I must admit I have never seen an asi file. I did compile the code, it did give me a couple of errors about bMsg not being initiated due to the goto Mission failed statement. I did a temp work around til I spend the time to see what was going on ( only had about 10 mins to look at it ). and compiled it to a dll. renamed the dll scmmod.asi and it seemed to work.

 

How does gtavc know to load the asi file? Since I have not been here in a while has this all been discussed? I saw the dx thread but that is loaded differently as a wrapper to dx.

 

Well again a mighty thanx

Share this post


Link to post
Share on other sites
steve-m
How does gtavc know to load the asi file? Since I have not been here in a while has this all been discussed? I saw the dx thread but that is loaded differently as a wrapper to dx.

Normally .asi files are plugins for the Miles Sound System the game uses, so it scans for those files on startup and executes them. You could also name it .m3d or .flt, I think flt files are loaded last (if you need to overwrite settings made by an asi file). All are simple dll files.

Share this post


Link to post
Share on other sites
Barton Waterduck

 

I did alot of mission coding never released to anyone but friends and I using gtama.

If you aren't interested in supporting the mission modding community then PLEASE keep that to yourself. And if you can't handle reading my personal opinions, then please keep that to yourself too. And please save your account info the next time you create one. It's starting to get seriously annoying. Thank you.

Edited by Barton Waterduck

Share this post


Link to post
Share on other sites
gadfly
If you aren't interested in supporting the mission modding community then PLEASE keep that to yourself. And if you can't handle reading my personal opinions, then please keep that to yourself too. And please save your account info the next time you create one. It's starting to get seriously annoying. Thank you.

I can HANDLE your opinions fine. HTF am I not handling them? Heh. I just disagree with them. I have seen you many many times complain here about other peoples work and a opinions. I find it insanely funny how you say I cant HANDLE your opinions then tell me not to post MINE. Heh.

 

Sometimes I have to wonder if you are for real or just a troll. Even though I much prefered the gtama editor to yours, I never bashed your contribution or your editor. I think its great if people like your code syntax.

 

I am glad that now I can code missions in C and will in fact be working on some missions that I will share here with others when I am done with them. Barton what I dont understand about you, is why you constantly need to attack other peoples contributions? If you dont find them usefull then dont use them.

 

 

 

Share this post


Link to post
Share on other sites
Barton Waterduck

 

If you aren't interested in supporting the mission modding community then PLEASE keep that to yourself. And if you can't handle reading my personal opinions, then please keep that to yourself too. And please save your account info the next time you create one. It's starting to get seriously annoying. Thank you.

I can HANDLE your opinions fine. HTF am I not handling them? Heh. I just disagree with them. I have seen you many many times complain here about other peoples work and a opinions. I find it insanely funny how you say I cant HANDLE your opinions then tell me not to post MINE. Heh.

 

Sometimes I have to wonder if you are for real or just a troll. Even though I much prefered the gtama editor to yours, I never bashed your contribution or your editor. I think its great if people like your code syntax.

 

I am glad that now I can code missions in C and will in fact be working on some missions that I will share here with others when I am done with them. Barton what I dont understand about you, is why you constantly need to attack other peoples contributions? If you dont find them usefull then dont use them.

Well, first of all, I guess this belongs in the blarg forum, but I'm posting because I'm curious about what exactly you're talking about. It seems to me that whenever I make ANY suggestions to ANYTHING no matter what it is, just because it's me making the suggestions, people are telling me I complain about their work. In this thread, I was very careful to just point out some facts about what I remember about a tool released for GTA 3 without actually having any opinions about it in any way. And what's the first thing that happends ? Y-Less comes in here and asks why this topic isn't locked ? A poll is started in the Myriad forum to get peoples opinions about a radar and when I suggest making the poll bigger by including different color themes to the radar the hole place goes bonkers ? When people can't handle the simplest suggestions or opinions, how am I supposed to be able to respect those people ? I'm just sitting there stairing at the screen thinking "What the hell is this BS ? Who the hell are these people ?". And then I usually give up, turn of my PC and watch TV. I have this limit you see. I can handle just -- that much bs before I switch off and get on with my life. That I have this function in my brain makes me feel good too. Very good. Does this help ?

 

edit: I think I'm actually gonna make a thread in the blarg forum to ask people these questions. I guess it could be "fun" (or just get nasty, who cares). Damn, it seems the blarg forum is gone. sucks.

 

Edited by Barton Waterduck

Share this post


Link to post
Share on other sites
Kryptos

Life is opinionated. He who believes solely in religion and denounces science is as ignorant as he who believes solely in science but denounces religion. You see, both systems were created by mankind, and to understand humanity you must first understand this key relationship which has plagued our hopeless species since its origin, being that of evolution from single celled organisms or the hand of God. If you don't enjoy doing something, as it would seem you don't at times, then don't waste your time doing it, no matter the consequence. If people don't respect what you do then obviously they won't respect what you accomplish, and instead of spending your life trying to change those people enjoy the aspects that don't involve them. There are billions of people on Earth, there's no point in creating an ulcer for yourself over a small group that represent nothing more than 7.14 e-6% of our population. And please spare me any rants that may follow, this is merely a piece of advice, not a specification that must be lived by, and yes, this has everything to do with the previous confrontation.

Share this post


Link to post
Share on other sites
jacob.
Life is opinionated. He who believes solely in religion and denounces science is as ignorant as he who believes solely in science but denounces religion. You see, both systems were created by mankind, and to understand humanity you must first understand this key relationship which has plagued our hopeless species since its origin, being that of evolution from single celled organisms or the hand of God. If you don't enjoy doing something, as it would seem you don't at times, then don't waste your time doing it, no matter the consequence. If people don't respect what you do then obviously they won't respect what you accomplish, and instead of spending your life trying to change those people enjoy the aspects that don't involve them. There are billions of people on Earth, there's no point in creating an ulcer for yourself over a small group that represent nothing more than 7.14 e-6% of our population. And please spare me any rants that may follow, this is merely a piece of advice, not a specification that must be lived by, and yes, this has everything to do with the previous confrontation.

Couldn't have said it better myself! inlove.gif

 

Dunno why barton is taking this one person's opinion so seriously. Anyway, this looks awesome, can't believe i missed it! Going to try it now.

Share this post


Link to post
Share on other sites
Y_Less
If you aren't interested in supporting the mission modding community then PLEASE keep that to yourself. And if you can't handle reading my personal opinions, then please keep that to yourself too. And please save your account info the next time you create one. It's starting to get seriously annoying. Thank you.

I can HANDLE your opinions fine. HTF am I not handling them? Heh. I just disagree with them. I have seen you many many times complain here about other peoples work and a opinions. I find it insanely funny how you say I cant HANDLE your opinions then tell me not to post MINE. Heh.

 

Sometimes I have to wonder if you are for real or just a troll. Even though I much prefered the gtama editor to yours, I never bashed your contribution or your editor. I think its great if people like your code syntax.

 

I am glad that now I can code missions in C and will in fact be working on some missions that I will share here with others when I am done with them. Barton what I dont understand about you, is why you constantly need to attack other peoples contributions? If you dont find them usefull then dont use them.

Well, first of all, I guess this belongs in the blarg forum, but I'm posting because I'm curious about what exactly you're talking about. It seems to me that whenever I make ANY suggestions to ANYTHING no matter what it is, just because it's me making the suggestions, people are telling me I complain about their work. In this thread, I was very careful to just point out some facts about what I remember about a tool released for GTA 3 without actually having any opinions about it in any way. And what's the first thing that happends ? Y-Less comes in here and asks why this topic isn't locked ? A poll is started in the Myriad forum to get peoples opinions about a radar and when I suggest making the poll bigger by including different color themes to the radar the hole place goes bonkers ? When people can't handle the simplest suggestions or opinions, how am I supposed to be able to respect those people ? I'm just sitting there stairing at the screen thinking "What the hell is this BS ? Who the hell are these people ?". And then I usually give up, turn of my PC and watch TV. I have this limit you see. I can handle just -- that much bs before I switch off and get on with my life. That I have this function in my brain makes me feel good too. Very good. Does this help ?

 

edit: I think I'm actually gonna make a thread in the blarg forum to ask people these questions. I guess it could be "fun" (or just get nasty, who cares). Damn, it seems the blarg forum is gone. sucks.

I didn't say I thought it should be locked!

 

I actually don't have a problem with you most of the time.

 

What I meant in my first post was I thought when the topic was made and pinned, they locked it as well, don't ask me why, I just did. if you read my post it says "I thought it HAD been locked" not "it SHOULD be locked".

 

That you posted before me was a coincidence and apparently you mis-interpreted my post.

Share this post


Link to post
Share on other sites
ot0_m0t0

If you are compiling it make sure you compile it as a simple .dll, later just rename it to .asi.

Other than that its inlove.gif

Share this post


Link to post
Share on other sites
jacob.

Does this gxt hook use ASM at all?

Is the DLL required to be injected into gta-vc.exe for the gxt hook to work?

Edited by !cMc! Jacob

Share this post


Link to post
Share on other sites
Kryptos

This actually uses the old ASI file trick. As Steve-M already stated:

 

 

How does gtavc know to load the asi file? Since I have not been here in a while has this all been discussed? I saw the dx thread but that is loaded differently as a wrapper to dx.

 

Normally .asi files are plugins for the Miles Sound System the game uses, so it scans for those files on startup and executes them. You could also name it .m3d or .flt, I think flt files are loaded last (if you need to overwrite settings made by an asi file). All are simple dll files.

Share this post


Link to post
Share on other sites
Spooky
Does this gxt hook use ASM at all?

Is the DLL required to be injected into gta-vc.exe for the gxt hook to work?

 

 

!cMc! Jacob goes to buy a Learn C++ in 24 Hours book

(..the last person that said that is now an advanced c++ scripter tounge.gif)

The GXT hook does use inline asm.

 

The DLL has to be loaded into the gta-vc process, but it doesn't matter how you go about that.

 

p.s. When you message me at 4am, you can assume that I'm sleeping if I don't reply. I'm not ignoring you.

Share this post


Link to post
Share on other sites
The_Grudge

EDIT:

Nevermind, Squiddy helped me smile.gif

Edited by The_Grudge

Share this post


Link to post
Share on other sites
jacob.

--------------------Configuration: scmhook - Win32 Release--------------------Compiling...MissionHook.cppC:\Documents and Settings\Jacob\Desktop\SCM Hooking 2\src\MissionHook.cpp(234) : warning C4018: '==' : signed/unsigned mismatchMissionThreads.cppSCMMod.cppScriptClasses.cppGameScripting.cppGxtHook.cppLinking...MissionThreads.obj : error LNK2005: _ReplaceTerm already defined in MissionHook.objSCMMod.obj : error LNK2005: _ReplaceTerm already defined in MissionHook.objScriptClasses.obj : error LNK2005: _ReplaceTerm already defined in MissionHook.objGameScripting.obj : error LNK2005: _ReplaceTerm already defined in MissionHook.objGxtHook.obj : error LNK2005: _ReplaceTerm already defined in MissionHook.objRelease/scmhook.dll : fatal error LNK1169: one or more multiply defined symbols foundError executing link.exe.scmhook.dll - 6 error(s), 1 warning(s)

 

I had a similiar problem on your previous DirectX hook's source but it one day mysteriously dissapeared. Now I try to compile this part 2 and I get the errors listed above.

Any suggestions? I haven't modified one line of the source.

 

[EDIT] Microsoft.com states that this can be caused from mixing libraries of different types. Right now I'm trying to compile as a Multithreaded DLL, is that right?

Edited by !cMc! Jacob

Share this post


Link to post
Share on other sites
MODMAN OG

How can I code a war between the Triads and the Mafia on GTA3?

Share this post


Link to post
Share on other sites
GodGell

wow! does this mean we won't have to use the sometimes helplessly primitive script language anymore? biggrin.gif yeey!

 

i'll see if i can rewrite my car shop with it. if i can, that'd mean:

 

0. the dll would be able to parse handling.cfg on each startup

1. no main.scm modification, aka savegames don't get f*cked up

2. no having to make a 65536-line script file for every car, aka i don't have to strip everything else off to make it under the script size limit

 

 

wow! but i see it's in visual c++.. we'll see whether i can compile it with BCB5. smile.gif

Edited by GodGell

Share this post


Link to post
Share on other sites
GodGell

 

[C++ Warning] GAMESCRIPTING.H(59): W8058 Cannot create pre-compiled header: initialized data in header

[C++ Warning] GameScripting.cpp(37): W8002 Restarting compile using assembly

[C++ Warning] GAMESCRIPTING.H(59): W8058 Cannot create pre-compiled header: initialized data in header

[C++ Warning] GameScripting.cpp(51): W8070 Function should return a value

[Tasm Error] GameScripting.asm(697): Forward reference needs override

 

lol, will there be a normal C++ version (not a visual c++ one) or do i have to get myself a vc++?

Share this post


Link to post
Share on other sites
ceedj

Some questions on this...

 

1) I don't want to use this to make custom missions. I wish to use my own scm, and just use this to listen for certain keypresses, and then excute 1 or 2 opcodes when the key IS pressed. I really don't need all the jibber-jabber in MissionHook.cpp, especially the CreateMain Thread - I don't want it to overwrite (or not use) what I have in my main scm. So what do I do with this file?

 

2) Where do I put the actual code? For example, suppose I figure out the keypress syntax. Where do I put that? And the opcodes themselves?

 

Sorry for the nebish questions. I really don't need this to do a whole lot though.

 

I'm using Dev C++ is it matters...

 

Thanks!

Share this post


Link to post
Share on other sites
albuemil

Hy,

 

I would like to know if this method could be used with San Andreas, and if so what changes would be needed (actually an example would be the best) ?

 

I've seen there's an "ASI Loader" for San Andreas (i think it was on www.gtatools.com), so maybe we could make this work.

 

Hope that somebody figures it out and gives us (newbies) an example lol.gif

 

Thanx in advance

Share this post


Link to post
Share on other sites
ceedj

Can anyone who's used this tell me what I can get rid of in spooky's source? I'd like this to run alongside my main.scm, not replace it. Or does anyone have a "stripped" version of this?

 

Any help is MUCH appreciated, as I can get the script to complie and run, but I can't figure out what to get rid of.

 

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 1 User Currently Viewing
    0 Members, 0 Anonymous, 1 Guest

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.