Mission Coding for Dummies - Custom Save Point

A Tutorial for Grand Theft Auto: San Andreas

Yo, buddy. We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Arman Ossi Loko points.
  • Post: Give Arman Ossi Loko your thoughts on this Tutorial.
  • Vote: Help Arman Ossi Loko win the Monthly Awards.
  • Rate: Give this Tutorial a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Tutorial.
  • Watch: Get notified when this Tutorial is updated.
Mascot

Sound fun?

Sign up

Already a Bananite? Login

Custom Save Point In this tutorial, we are going to make an easy custom save point. Be aware, that it doesn't work that well in MPACK. So if you want to make use of the custom save point in scm, then use the main.scm and no MPACK. Action Plan: 1) Create pickup and check if the player picked it up. 2) Show save screen and wait until the save is done 3) Clean up 1) Create pickup and check if the player picked it up This isn't too hard. If you followed the other tutorials in this topic too, you will be able to make it yourself. You can make it as follow: CODE > $save_x = 2488.6506 > $save_y = -1660.9884 > $save_z = 13.3359 > > 0395: clear_area 1 at $save_x $save_y $save_z range 1.0 > $SAVE_PICKUP = Pickup.Create(#PICKUPSAVE, 3, $save_x, $save_y, $save_z) > > repeat > wait 100 > until 0214: pickup $SAVE_PICKUP picked_up If you don't know what I'm doing here, I suggest that you take another look at this tutorial. 2) Show save screen and wait until the save is done You can show the save screen with one single opcode: CODE > 03D8: show_save_screen However, we have to do some other things before using this opcode, though. First, we have to set the $ONMISSION variable on 1, so the player doesn't get phonecalls and things like that. Second, we have to make sure that the player can't move, it would look strange when the actor is at a total different place when the save is done. CODE > $ONMISSION = 1 // integer values > Player.CanMove($PLAYER_CHAR) = False We have to wait until the save is done. Although you can't find a "save_done" in the opcode search tool or in the main.scm (you can find 83D9 (not save_done) though), it is possible and easy to use. CODE > repeat > wait 100 > until 03D9: save_done Combining these fragments, the second part of the code becomes: CODE > $ONMISSION = 1 // integer values > Player.CanMove($PLAYER_CHAR) = False > 03D8: show_save_screen > > repeat > wait 100 > until 03D9: save_done 3) Clean up What do we have now? We have the pickup which has to be picked up. Then a save screen will show up, and the code has to wait until the player finished the saving. You don't have to do anything about that saving, that is hardcoded. In this last part, we will fix the camera, and check if the player isn't near the save pickup anymore. Next to that, we have to destroy the pickup. CODE > > Pickup.Destroy($SAVE_PICKUP) > repeat > wait 100 > until Player.Defined($PLAYER_CHAR) > > Camera.Restore_WithJumpCut > Camera.SetBehindPlayer > Player.CanMove($PLAYER_CHAR) = True > > $ONMISSION = 0 > > repeat > wait 0 > until 80EC: not actor $PLAYER_ACTOR 0 near_point 2488.6506 -1660.9884 radius 2.0 2.0 > > jump @SAVE_LOOP The first line is to destroy the pickup. At the end, we will jump to the beginning (after waiting until the player isn't on that place any more), so the pickup will be created again. Then we restore the camera. The player has to be able to move again. Finally, we have to put the $ONMISSION variable back to 0, else it isn't possible to do another mission or get calls. The full code of a custom save point thread: CODE > :SAVE > thread "SAVE" > > // location of the save pickup > $save_x = 2488.6506 > $save_y = -1660.9884 > $save_z = 13.3359 > > :SAVE_LOOP > 0395: clear_area 1 at $save_x $save_y $save_z range 1.0 > $SAVE_PICKUP = Pickup.Create(#PICKUPSAVE, 3, $save_x, $save_y, $save_z) > > repeat > wait 100 > until 0214: pickup $SAVE_PICKUP picked_up > > $ONMISSION = 1 // integer values > Player.CanMove($PLAYER_CHAR) = False > 03D8: show_save_screen > > repeat > wait 100 > until 03D9: save_done > > Pickup.Destroy($SAVE_PICKUP) > > repeat > wait 100 > until Player.Defined($PLAYER_CHAR) > > Camera.Restore_WithJumpCut > Camera.SetBehindPlayer > Player.CanMove($PLAYER_CHAR) = True > > $ONMISSION = 0 > > repeat > wait 0 > until 80EC: not actor $PLAYER_ACTOR 0 near_point $save_x $save_y radius 2.0 2.0 > > jump @SAVE_LOOP > > end_thread [Click here to view the code in a stripped main.scm. ](http://pastebin.com/f692fe640 "")

Posts

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
Dutchy3010

Submitter

Arman Ossi Loko avatar
Arman Ossi Loko avatar Lurkin'
Admin Joined 10y
71,925 points Ranked 56th
63 medals 9 legendary 16 rare
  • GTAV First Adopter Medal icon
  • Submitted 15 Tools Medal icon
  • Submitted 30 Tutorials Medal icon
  • 1st place - 2015 Uberstyles Contest Medal icon
  • Achieved Admin clearance Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon

Arman Ossi Loko avatar
Arman Ossi Loko
KOPASSUS Incorporated Flag
KOPASSUS Incorporated

Redistributor
Are you the owner? Request Ownership
Sign up to access this!
Sign up to access this!
Sign up to access this!
Sign up to access this!

Category

Details

Difficulty Level
Beginner Difficulty

Attributes

Stats

Posts
0
Views
4,125
Date Added
5y
Date Modified
4y
bcp.crwdcntrl.net tracking pixel