Quadropheniac90 Posted January 3, 2006 Share Posted January 3, 2006 (edited) I haven't done any mission coding for quite some time, but I'm getting into it a bit more. I'm gonna post little scripts here, move this to the Mission Coding forum if needed. My first script is a little script for Vice City which stores the player's position every 250 ms, and when the player dies, he will spawn at the position on a path closest to the stored coordinates, that's why when you drive into water you will be spawned on the land closest to the place you drowned. This also takes effect when you're busted. You will have to remove the restart_if_busted/restart_if_wasted checks, otherwise you'll still spawn on those predefined locations. I haven't tested this with interiors yet, but I will, soon. Hope this is worth trying, I'll be making many more, most of which will be used in State of Liberty. A create_thread should off course be made. You have to place this before 'Mission 0' and put an end_thread in it, it crashes when you die if don't. EDIT: When you die or get busted in an interior, you will be placed on the path closest to it in the normal world. :Store0001: wait 250 ms00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]:Dead00D6: if 00118: actor $PLAYER_ACTOR dead004D: jump_if_false ££Store0001: wait 0 ms00A1: put_actor $PLAYER_ACTOR at [email protected] [email protected] [email protected] For the ones who don't want to mess around with their SCM, PM me and I'll send you either a stripped SCM with the feature, or a normal one. Edited January 3, 2006 by teun.steenbekkers Link to comment Share on other sites More sharing options...
Y_Less Posted January 3, 2006 Share Posted January 3, 2006 You know this is the default behaviour for a stripped script? If there are no restart point defined the game will automatically place you on the nearest ped path point. Link to comment Share on other sites More sharing options...
Quadropheniac90 Posted January 3, 2006 Author Share Posted January 3, 2006 (edited) I tested it without 'restart_if' codes and without my code and it would spawn me beneath the Leaf Links Club. Oh well, even if my way is more of a hassle to do, I did something. EDIT: Hmmm, you're right. Well then, I'll just leave it there, so people know that the 'restart_if' opcodes should all be deleted for the respawning to work, with or without that piece of code, I'd say it just takes space... Edited January 3, 2006 by teun.steenbekkers Link to comment Share on other sites More sharing options...
Quadropheniac90 Posted January 3, 2006 Author Share Posted January 3, 2006 (edited) OK, a new script, I still have to figure this one out a bit, the last three parameters of the 'distribution_actor' opcode, I don't know exactly what those do. Anyways: This script select a pedestrian every 2 seconds and gives it a variable, then it removes any reference to the ped, because otherwise the engine would be stressed and it'd crash. There are alot of possibilities here. For example: 1. Make random peds Tommy, or Phil, or Lance, or, well, every IGActor. Well, just one model at a time. 2. Make random peds burn and fade away when dead. 3. Make peds' cars explode. 4. Make peds hold their cellphones. 5. Make peds explode. 6. Make peds riot. 7. Make yourself a celebrity (everybody looking at you). 8. Many more. I will post some example codes when I get them figured out allright. :Storecoords0001: wait 0 ms0054: store_player $PLAYER_CHAR position_to $POSX $POSY $POSZ0086: $POSXADD = $POSX;; floating-point values only0009: $POSXADD += 20.0;; floating-point values0086: $POSYADD = $POSY;; floating-point values only0009: $POSYADD += 20.0;; floating-point values0086: $POSXMIN = $POSX;; floating-point values only000D: $POSXMIN -= 20.0;; floating-point values0086: $POSYMIN = $POSY;; floating-point values only000D: $POSYMIN -= 20.0;; floating-point values:Getactor0001: wait 3000 ms058F: unknown_create_distribution_actor [email protected] at $POSXADD $POSYADD or_at $POSXMIN $POSYMIN flag 1 0 1:Setactor0001: wait 0 ms:Remove01C2: remove_references_to_actor [email protected]: jump ££Storecoords OK, this is an example that didn't crash due to memory errors (At least I think they were...) This script fades peds in a range of 20 around you away. It works pretty well, I walked down the street and every single ped disappeared in front of me. Except for cops, but I think they're 'immune' for mission scripting. Have fun: :Storecoords0001: wait 0 ms0054: store_player $PLAYER_CHAR position_to $POSX $POSY $POSZ0086: $POSXADD = $POSX;; floating-point values only0009: $POSXADD += 20.0;; floating-point values0086: $POSYADD = $POSY;; floating-point values only0009: $POSYADD += 20.0;; floating-point values0086: $POSXMIN = $POSX;; floating-point values only000D: $POSXMIN -= 20.0;; floating-point values0086: $POSYMIN = $POSY;; floating-point values only000D: $POSYMIN -= 20.0;; floating-point values:Getactor0001: wait 3000 ms058F: unknown_create_distribution_actor [email protected] at $POSXADD $POSYADD or_at $POSXMIN $POSYMIN flag 1 0 1:Setactor0001: wait 0 ms034F: destroy_actor_with_fade [email protected]:Remove01C2: remove_references_to_actor [email protected]: jump ££Storecoords Edited January 3, 2006 by teun.steenbekkers Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now