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. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    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 IV 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 SA Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III 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

demonj0e

Make A Pick Up Spawn A Car

Recommended Posts

demonj0e

Ok Im Making A total Conversion Mod For SA

And I Tought It Would Be Cool To Add Some Hidden Things In The Game

I Want To Hide A Pickup Somewhere And Then When You Find It It Spawns The Batmobile Somewhere

 

 

So Like The Hidden Packeges Where U Find about 50 and wepons spawn At Your Hideout

 

Can Anyone Help Me With This

 

are there any hidden packages in sa?

i havent seen any

ill try looking at the code in a vc scm now

Share this post


Link to post
Share on other sites
superglitch

I don't know how to. But i imagine you need to make a mission that's always running that has a triger effect that causes another mission to start, being the batmoblie always spawning in the same spot.

 

Have you ever played SA? There are Horse Shoes and Osters(or however you spell that).

Share this post


Link to post
Share on other sites
Demarest

50 Horseshoes, 100 tags, and 50 photo-ops were the packages. I don't think oysters count because they weren't island specific and didn't have the same pickups yield.

 

The vehicle for pickup idea is an easy one to pull off. You just have to make it a pickup that otherwise has no hard-coded effect. In GTA3, there was the briefcase and rampage, in VC, those plus the keycard... Not sure what you could use in SA, but I'll bet the 2 player pickups have no hard-coded effects. You create that, then write a thread that sniffs if it's been picked up. If so, destroy it, request car, check if it's loaded, if so, spawn it, put player inside (to avoid him picking up the pickup again), then respawn the pickup.

Share this post


Link to post
Share on other sites
demonj0e

thanks ill look if the 2 player pickup is still in the code now

 

how could i make it so the pickup is only picked up once unless u retart before it is picked up?

Share this post


Link to post
Share on other sites
Demarest

Two ways and you should use them both. First of all, setting a pickups type to 3 makes it a one time pickup. Also, any time you're detecting if a pickup is picked up, you should always immediately destroy it to prevent it from possibly gumming up memory. The latter is PROBABLY only necessary for one time pickups, but can't hurt to use it anytime a pickup is meant to trigger code and not only have engine effects.

 

Speaking of engine effects, I forgot to mention that VC's (and probably SA's) save pickup had no hardcoded effects.

 

It should also be noted that there IS a limit as to how many pickups the engine can concurrently track. You don't have to use a pickup though, you could always use a mission sphere that doesn't appear on radar and sniff for location. Again, the engine can only track so many of those as well.

Share this post


Link to post
Share on other sites
demonj0e

found sum code in the main.scm for pickups

 

could this be used After Changing It A Bit

 

 

0213: $SAVE_PICKUP(8) = create_pickup #PICKUPSAVE type  3 at $SAVEPOINTX(8) $SAVEPOINTY(8) $SAVEPOINTZ(8)

 

 

After Changng Like This

 

 

0213: $SECRET_PICKUP1 = create_pickup #BRIBE type  3 at 2504.047 -1678.798 13.37605

 

 

im still learning scm so mayb not be very much correct im sure theres alot more code like delete pickup and stuff

Share this post


Link to post
Share on other sites
Demarest
Yep. In fact, you can take it a step further and immitate the sniff thread that checks to see if that pickup was picked up. It's just that instead of going to the save screen, you spawn your car.

Share this post


Link to post
Share on other sites
demonj0e

sorry but im not very good at coding but can u show an example code or summin

 

cuz i dont realy undertsand what u mean

 

 

btw u got msn or summin cuz it seems its just me nd u in this topic chatting about this

Share this post


Link to post
Share on other sites
Demarest

I think if I did have MSN, the way you type would irritate me lol.gif Forums are better because a) ANYBODY can chime in (2 heads are better than 1) and b) then others looking for the same info will have their answer already handy.

 

I don't have SA, so I can only really discuss coding concepts on the matter. It's not as hard as you're making it out to be though. Using the save icon we were already talking about, find one and looke for its variable name. Now search for that name and you're bound to find a line that says something like "var picked up" in an IF check. That's the area of code to immitate. Except instead of jumping to a save screen, then immitate code that spawns a car.

 

Have you read through the pinned tutorial thread already?

Share this post


Link to post
Share on other sites
demonj0e

Well Demerast Would This code Be Perfect?

I think im Getting The Hang Of This

Sorta

 

 

:SECRET0213: @2 = create_pickup  #BRIBE type 3 at 2247.395 -1253.71  25.44028:SECRET10001: wait  500 ms00D6: if  00214: pickup @2 picked up004D: jump if false ££DSECRET100D6: if  00215: destroy pickup  @2016A: fade  0 ()  500 ms0001: wait  1000 ms00A5: create_car #BMX at  2470.066  -1671.138  13.31997016A: fade  1 (back)  500 ms0002: jump ££SECRET004E: end thread

 

 

and whats wrong with the ways i write? sarcasm.gif

 

EDIT: Dam Just Tested It Crashes The Game When I Pick It Up sad.gif

 

Edited by demonj0e

Share this post


Link to post
Share on other sites
superglitch

change #BMX to the vechile number i think you can find it in the ide

Share this post


Link to post
Share on other sites
demonj0e
ok ill try taht but bmx shoudl work cuz normally if u put somethign like that it will say model "BMX" was not defined or summin liek that

Share this post


Link to post
Share on other sites
Demarest

It's not a bad effort at all. Let's work with it. For now, I'm going to keep fading out of it. It's best to get your core code working first, then add aesthetics like a fade...

 

As a side note, you don't need an end thread command. Since the command before it is a jump, the end thread will never be executed. No point in having commands you don't need. For that matter, you had a 2nd if you didn't need. IFs always come with jump if false's and always have at least one conditional between them. Where your 2nd one is, you're not checking anything, so it isn't needed. Also, your existing jump if false had a D in the label name that didn't belong. That should've stopped it from compiling altogether (or maybe you accidentally typed it here). Speaking of not compiling, your create car line doesn't give the car a name. That should've stopped it from compiling too.

 

Check original code. You'll notice that it's a time-honored tradition in SCM coding to load the model before creating a new car. That's probably where your crash is coming. I'm going to write this freehand (sort of), so be sure you modify it to be SAMB compliant

 

 

:SECRET0213: @2 = create_pickup  #BRIBE type 3 at 2247.395 -1253.71  25.44028:SECRET10001: wait  500 ms00D6: if  00214: pickup @2 picked up004D: jump if false ££SECRET10215: destroy pickup  @2request model #BMXload requested models:SECRET20001: wait  0 ms00D6: if  0model #BMX loaded004D: jump if false ££[email protected] = create_car #BMX at  2470.066  -1671.138  13.31997release model #BMXset car z angle to WHATEVERremove references to car @3put actor $PLAYER_ACTOR somewhere0002: jump ££SECRET

 

 

The most important thing is that you see the old request model, is it available, NOW use it that was added. Another common thing I added was the car's z angle. Not necessary, but usually desired. Since your code loops back to respawn the pickup, you'll want to move the player somewhere. Possibly beside the driver's door of the car. Reason is because he's standing where the pickup is to pick it up. If you don't move him, by time it creates another one, he'll just pick it up again and it will start raining BMXs biggrin.gif Last but not least, it's important that you release model when done as well as remove references to a car once you're done manipulating it. Otherwise, you'll eventually stuff up the memory.

 

I like to see people trying, so keep it up. Again, the above is shorthand where opcodes are missing. Just be sure to put them into your code correctly and you should be fine. Keep us posted.

Share this post


Link to post
Share on other sites
demonj0e

thanks dem the d was a spelling mistake i noticed when compiling it said cant find thread DSECRET so i had changed that

 

ill try work off ure code and i dont want the pickup to apear again

so do i remove the end bit

 

0002: jump ££SECRET

 

and replace it with

 

004E: end thread

 

?

 

also how would i get it to display some text on the screen saying

 

Congratulations Uve Found 1/5 Secrets A New Car Has Spawned Somewhere in LS Try Find It, HINT:Its Releated To A Movie

 

ill have alook in the code now for something like that maybe the information pickup

 

thanks for all your help dem biggrin.gif

 

btw u got san andreas yet?

 

EDIT: Fixed Up The Code With The Missing Opcodes And Edited A Bit

When I Go Ingame The Pickup Spawns But It Dont Do Anything

 

Heres The Code

 

 

:SECRET0213: @2 = create_pickup  #BRIBE type 3 at 2247.395 -1253.71  25.44028:SECRET10001: wait  500 ms00D6: if  00214: pickup @2 picked up004D: jump if false ££SECRET10215: destroy pickup  @20247: request_model #BMX038B: load_requested_models:SECRET20001: wait  0 ms00D6: if  08248:   NOT   model #BMX available004D: jump if false ££SECRET200A5: @3 = create_car #BMX at  2470.066  -1671.138  13.319970249: release_model #BMX01C2: remove references to car @3004E: end thread

 

 

 

Edited by demonj0e

Share this post


Link to post
Share on other sites
Demarest

btw u got san andreas yet?
No cryani.gif Otherwise, I might try to give you less of a shorthand answer.

 

 

i dont want the pickup to apear again so do i remove the end bit

 

0002: jump ��SECRET

 

and replace it with

 

004E: end thread

Yes, except that...

 

 

Congratulations Uve Found 1/5 Secrets A New Car Has Spawned Somewhere in LS Try Find It, HINT:Its Releated To A Movie
See, at the time, I didn't realize your coords were so far away from the pickup. So if you use the command I mentioned of remove references to car @3, it will just disappear altogether. Since it's so far away, you'd have to have another loop inside that would look something like this

 

@3 = create_car #BMX at  2470.066  -1671.138  13.31997release model #BMXset car z angle to WHATEVERput actor $PLAYER_ACTOR somewhere:SECRET30001: wait  500 ms00D6: if  0player $PLAYER_CHAR defined004D: jump if false ��SECRET300D6: if  0actor $PLAYER_ACTOR driving @3004D: jump if false ��SECRET3remove references to car @3004E: end thread

 

 

 

also how would i get it to display some text on the screen saying
As per usual, I'll recommend checking original code. There seems to be a bazillion ways to put text on screen. You'll need to add your custom line to the GXT. Not even sure if that's possible yet in SA.

 

Last but not least, I'm not sure how fun it would be to have to get a pickup and then the car. Especially if it's just that one time. Maybe store the time of day and weekday when the pickup is picked up, then when the time and day match again (a week later), respawn it. Just an idea.

Share this post


Link to post
Share on other sites
demonj0e

ooh didnt see ure post there so look at my edted post

 

this is my code now

 

 

:SECRET0213: @2 = create_pickup  #BRIBE type 3 at 2247.395 -1253.71  25.44028:SECRET10001: wait  500 ms00D6: if  00214: pickup @2 picked up004D: jump if false ££SECRET10215: destroy pickup  @20247: request_model #BMX038B: load_requested_models:SECRET20001: wait  0 ms00D6: if  08248:   NOT   model #BMX available004D: jump if false ££SECRET200A5: @3 = create_car #BMX at  2470.066  -1671.138  13.319970249: release_model #BMX01C2: remove references to car @3:SECRET30001: wait  500 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump if false ££SECRET300D6: if  000DF:   actor $PLAYER_ACTOR driving @3004D: jump if false ££SECRET301C2: remove references to car @3004E: end thread

 

Share this post


Link to post
Share on other sites
Demarest

Your code as is will either crash or stay trapped in a loop. Your model available shouldn't be a NOT.

 

Also, remove the first instance of the remove reference command. You're so far away from where the car is spawned, that it will disappear once you remove reference. Then when you check to see if you're driving a non-existent car, the game will crash.

Share this post


Link to post
Share on other sites
demonj0e

omg my mission builders f*cked up all the codes in my main.scm stil and works when i play game but when i decompile it its just the same as the gta insandreas main.scm file

 

after making theese changes will it fix it so it actually picks it up?

 

 

Share this post


Link to post
Share on other sites
Demarest
First of all, you should never compile then decompile. The whole reasons the MB's save as TXT first, then SCM is so that you can retain all your custom label/var names and notes. I can't speak for SA, but in the GTA3 and VC Builders, I just press F7 and it compiles. Then I delete main.scm and rename my new SCM to main.scm. I realize that F6 does all of the above, but there have been times where my updated code wasn't taking even though the main.scm file properties indicated it had been overwritten. So I play it safe. Is that what you're experiencing?

Share this post


Link to post
Share on other sites
demonj0e
well i acidently overote my txt file cuz i was looking at sum code from sa open up mod to see how to enable car garages from the start then i found out i had overwriten it and then tried decompile and found it was just sumhow using sum other main.scm file with the contents of main.scm from gtainsandreas by viper187

Share this post


Link to post
Share on other sites
demonj0e

ok fixed it so it will pick it up but my model dont spawn

 

i searched through main.scm but i havent yet seen any code when it has just

 

 

8248:   model #BMX available

 

 

all ive seen is

 

 

8248:  NOT model #BMX available

 

 

anyone whoes had a good look at sa code help me out here

Share this post


Link to post
Share on other sites
Demarest
You can't just take away the NOT. You also have to change the first digit of the opcode from 8 (which means NOT) to 0.

Share this post


Link to post
Share on other sites
demonj0e

thankyou so much dem ive learned so much from this and some little other testing

 

ive got this working now i just need to find a good place to hide my pickup tounge.gif

 

heres ma code if anyone else would like sumthing like this biggrin.gif:D:D

 

 

 

:SECRET0213: @2 = create_pickup  #CJ_MONEY_BAG type 3 at 2247.395 -1253.71  25.44028:SECRET10001: wait  500 ms00D6: if  00214: pickup @2 picked up004D: jump if false ££SECRET10215: destroy pickup  @20247: request_model #BMX038B: load_requested_models:SECRET20001: wait  0 ms00D6: if  00248:  model #BMX available004D: jump if false ££SECRET200A5: @3 = create_car #BMX at  2470.066  -1671.138  13.319970249: release_model #BMX:SECRET30001: wait  500 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump if false ££SECRET300D6: if  000DF:   actor $PLAYER_ACTOR driving004D: jump if false ££SECRET301C2: remove references to car @3004E: end thread

 

 

of course change the co-ords and model used the pickup and the moel spawned

 

all i gotta do now is make it display some text and i have a grete base code for sum other stuff i hope

 

btw i was thinking of making a decent website full of san andread opcodes code examples coding help and tuts and sum stuff like that the opcode db is ok but for newbies it can sumtimes be hard to understand

 

biggrin.gif:D:D thanks again dem

Share this post


Link to post
Share on other sites
Demarest
No problem. Actually, one problem. First time you get into any vehicle, your car is going to disappear. You only check if you're driving. You want to check if you're driving THAT car.

Share this post


Link to post
Share on other sites
demonj0e

it wouldent allow me it said it was to long or summin

Works Fien Anyway Cuz I drove A Bike to Get There Then I Rode MY Spawned Bike around a Bit biggrin.gif

 

Edited by demonj0e

Share this post


Link to post
Share on other sites
Bigun

Well I think that code wouldnt work. Try driving a car OTHER than a BMX to the spawned car(BMX) because it might disappear that way. Also it will not disappear if its quite close to where the player is.

 

NOW, to be a little more helpful tounge2.gif

It is possible Dem (custom text display). Personally I cant wait until you get SA aswell, you're so helpful even without it colgate.gif

 

Step by step custom text tutorial...

 

1. Download GTA SA GXT Editor by Hammer.

2. Open it and load your american.gxt (in \text folder).

3. Go to Entry -> Add

4. Choose a name. Make it quite short, I've been having trouble with SAMB compaining about a -little- long name entries :S

For this 'tutorial' we will use 'PICK1'.

5. Write your text in the right big textbox.

You want it something like:

"Congratulations! You've found a secret! A car has been spawned somewhere in LS. Hint: It's related to a movie."

6. Save your GXT.

7. Use this opcode in SAMB to display the text:

 

00BB: text_lowpriority 'PICK1'  1500 ms  1

 

1500 ms is how much time the text stays. Its alright now, 1.5 seconds.

You should guess-the-rest.

 

Note: that I didnt follow this tutorial step by step and test, but I managed this stuff in the past and I'm sure thats how its done.

Note #2: MB might complain theres no entry named PICK1; put your custom american.gxt in the SAMB folder if this happens.

 

And... I'm probably more shameless than Dem so..

He said that your writing is pissing off, you asked why.

It's because You Write Like This And It's Pretty Much Annoying.

And you do it randomly too.. It hurts some people in the eyes to see that stuff you know >_>

Better even use all lowercase.

 

Good luck!

Edited by Bigun

Share this post


Link to post
Share on other sites
demonj0e

big thanks ill try that soon

 

and ye now i see y my writing is annoying

i kinda rush it aswell and its just a habbit

Writing Like This

with caps on start of every word

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.
Note: Your post will require moderator approval before it will be visible.

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.


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

×
×
  • Create New...

Important Information

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