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

    1. GTANet.com

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
Flieboy101

Need some help programming cars

Recommended Posts

Flieboy101

So yeah I want to program certain cars on Vice City so that they can do certain things when you press certain buttons such as changing the time and other such things. I was just wondering what I have to edit to do this and also if you could nudge me in the way of how I would go about making them work. Cheers guys.

Share this post


Link to post
Share on other sites
Mark

Not possible matey.

Share this post


Link to post
Share on other sites
Flieboy101

Well seen plenty of people do it ie the bttf mod so how is it not possible?

Share this post


Link to post
Share on other sites
DexX

he means it's not possible with the default data that vehicles have.

The extra effects you see are scripted, via mission scripting, which is where i'm moving this topic to.

Share this post


Link to post
Share on other sites
SteaVor

That's definitely not the Mission Scripting forum dozingoff.gif ... take the next door down the floor please.

 

On-topic:

DexX is right! rah.gif

 

You better tell us what exactly you're trying to accomplish.

Share this post


Link to post
Share on other sites
Flieboy101

Sorry guys I knew it was mission scripting but seeing as it was vehicles I thought it would be better in the vehicles section. Anyone want to give me a hand then? Basically what I want to do is like make cars fly and have time control and autodrive n stuff like that.

Share this post


Link to post
Share on other sites
Demarest

Anyone want to give me a hand then?
There's a requests forum. Inquiries outside the request forum are treated as if the person is interested in learning how to do this themselves.

 

 

Basically what I want to do is like make cars fly and have time control and autodrive n stuff like that.
I've not seen the BTTF mod in ages, but it sounds like maybe THAT is what you're looking for. Anyways, you can just as easily make cars fly with the Admin Console. Time control is easy. Is player defined, is player driving AND buttons ___ and ___ being pressed. Set time to ___. I'm not sure what you mean by auto drive, but I did write a Cruise Control mod for VC. You're welcome to peek at the source code for ideas or just plain use it if it suits you.

Share this post


Link to post
Share on other sites
Flieboy101

Can you elaborate on the time control is easy because I also want to add cool effects as you do and also while I'm here is there any way for you to program weapons to do different things.

Share this post


Link to post
Share on other sites
Demarest

Time control is easy: There is an opcode to make the clock whatever time you want. If you just want that to happen when certain keys are pressed, you put the command after an is key pressed check. And so on.

 

I don't know what you mean by cool effects though.

 

Most of what the weapons do is controlled by weapons.dat. Open that file in Notepad and it actaully kind of tells you what all that info does.

Share this post


Link to post
Share on other sites
Flieboy101

Oh right I see, well what I really want to do is like reverse/fastforward time and if you could tell me how to do that and also for cool effects I mean like flashing lights and whatever if you could help with that. And as for weapons I mean can you use them to spawn cars or something like that.

Share this post


Link to post
Share on other sites
SteaVor

 

And as for weapons I mean can you use them to spawn cars or something like that.

Yes you can, you could check for 'is weapon ... currently equipped' AND 'is key 17 (attack/shoot) pressed' as trigger conditions for example.

Share this post


Link to post
Share on other sites
Flieboy101

Sounds good thanks for the advice what about the programming of time and the effects can you help with that?

Share this post


Link to post
Share on other sites
SteaVor

You'd have to be more specific about that, like 'when I press that button, the time should fastforward to 2 hours later'. But everything you mentioned is possible. Make your requests as specific as possible, break them down to the parts and do some research yourself. It's all pretty basic stuff when you're consulting the opcode database and such. Implementation isn't hard either.

Share this post


Link to post
Share on other sites
Flieboy101

Basically what I mean is pressing like reverse and side mission to make time reverse and you can watch the clock going backwards and it does it until you let go and forward and side mission to make the clock move forward quickly. Also I'de like the car to float in the air or something while I am doing it or something like that. Where is this opcode database please?

 

In fact what would be cool is if you could like show me what codes to use and whatever, and like is there a way to make like flashing lights and weird effects like that?

Edited by Flieboy101

Share this post


Link to post
Share on other sites
SteaVor

SA Database

As you want to manipulate the time you would search for 'time' there and would find 'get_current_time' (00BF) and 'set_current_time' (00C0), which would be used to program the core functionality (store current time to variables, increase the vraiable holding hours or minutes by a certain amount, set it to the new value).

Connecting this with a 'key_pressed' check should make the basic idea work.

So the strucure would go like this:

 

- check if player is defined

- check if key 19 (sub-mission while in car) and 16 (forward) are pressed

- if yes, get_current_time, increase by whatever amount you want, set_current_time

- if not, check for key 19 and 14 (backward) and do the same as above

 

I don't know if it's possible to make the car float in the air, the physics system might interfere.

Edited by SteaVor

Share this post


Link to post
Share on other sites
Flieboy101

OK what about the effects and how can this make the time increase and decrease by seconds etc and also I am not certain about how to like make the codes work once Ive put them in like what do I put at the start and end. And I want to use it for Vice CIty not SA so you know but wil those codes still work?

Edited by Flieboy101

Share this post


Link to post
Share on other sites
SteaVor

Yes, they will work, the link to the VC database is the same as for the SA one, except that you'll need to replace 'sa' with 'vc' in the URL.

 

Possible code for the thread:

 

:TIMECONTROL0001: wait <put your desired value here, determines how frequently the time is changed> ms00D6: if 00256:   player $PLAYER_CHAR defined 004D: jump_if_false ££TIMECONTROL00D6: if 100E0:   is_player  $PLAYER_CHAR driving00E1:   key_pressed 0 19004D: jump_if_false ££TIMECONTROL00D6: if 000E1:   key_pressed 0 16004D: jump_if_false ££TIMEBACK ...0002: jump ££TIMECONTROL:TIMEBACK00D6: if 000E1:   key_pressed 0 14004D: jump_if_false ££TIMECONTROL...0002: jump ££TIMECONTROL

 

 

That would be the basic structure, with only the part about time manipulation missing.

The ... parts need to be replaced by only three lines to make the code fully work.

(You're lucky that I was able to copy&paste most of the code, but it's nevertheless completely untested.)

 

I don't really know about the feasibility of special effects though.

Edited by SteaVor

Share this post


Link to post
Share on other sites
Flieboy101

Thanks man thats really useful but do you know how to increase and decrease the time and is there anything I need to put before and after the code?

Share this post


Link to post
Share on other sites
SteaVor

This is a thread, meaning you'll have to put this code at the end of the MAIN part, right before Mission 0, and have to put a create_thread line together with the others in the script you're using .

And I think it's possible for you to replace the '...' with the 3 lines of code yourself - I basically told you all about the first and the last line you'll have to add, so you'll just have to search for the opcode that adds or substracts a value from a local variable.

Share this post


Link to post
Share on other sites
Flieboy101

Also, I have been using the bttf mod and even when I delete everything out of the main.scm and put in a stripped script it still does the bttf stuff, how do I fix this?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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