|
 |
|
|
|
|
|
GTA Modification Forums
New Savegame places. How to Create new savegame places.
 |
|
 |
| |
SmileyHam  |
Posted: Thursday, Jul 5 2012, 12:40
|
Peon

Group: Members
Joined: Apr 17, 2011

|
Here is a mod that makes the majestic hotel a safe house. It's a .net script. I think it might help. EDIT: It's a .VB script and requires .net scripthook. | CODE | Imports System Imports System.Windows.Forms Imports GTA
Public Class Majestic Inherits Script Dim Spawncoords As New Vector3(-180.8, 580.4, 122.8) Private Doormodel As Model = "ab_ritz_aptdoor" Dim coordies As New Vector3(-160.0, 591.0, 119.0) Dim coordies2 As New Vector3(-160.0, 593.0, 119.0) Dim coordies3 As New Vector3(-155.66, 592.7, 359.42) Dim coordies4 As New Vector3(-144.25, 6107.32, 14.3) Public Sub New() Interval = 500 If Player.Character.Exists = True Then Game.FadeScreenOut(1000, True) 'Game.LoadEnvironmentNow(Spawncoords) Player.Character.Position = Spawncoords World.CreateVehicle("MAVERICK", coordies3) Game.FadeScreenIn(1000) Else End If End Sub
Private Sub Majestic_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick Dim Var6 As Single = 0 SetStateOfClosestDoorOfType(Doormodel, coordies, 0, Var6) SetStateOfClosestDoorOfType(Doormodel, coordies2, 0, Var6) End Sub
Private Sub SetStateOfClosestDoorOfType(ByVal o As GTA.Model, ByVal coords As Vector3, ByVal locked As Boolean, ByVal angle As Single) Native.Function.Call("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE", o, coords.X, coords.Y, coords.Z, locked, angle) End Sub
Private Sub Majestic_KeyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown Select Case e.Key Case Keys.F Dim PPos As Vector3 = Player.Character.Position Dim LiftTop As New Vector3(-184.07, 597.44, 114.44) Dim LiftBottom As New Vector3(-182.0, 597.4, 15.6) If PPos.DistanceTo(LiftTop) < 4 Then Game.FadeScreenOut(1000, True) Player.Character.Position = LiftBottom Player.Character.Heading = 280 'Game.LoadEnvironmentNow(LiftBottom) Game.FadeScreenIn(1000) ElseIf PPos.DistanceTo(LiftBottom) < 4 Then Game.FadeScreenOut(1000, True) 'Game.LoadEnvironmentNow(LiftTop) Player.Character.Position = LiftTop Player.Character.Heading = 280 Game.FadeScreenIn(2000) ElseIf PPos.DistanceTo(Spawncoords) < 5 Then Game.ShowSaveMenu() End If
End Select End Sub
End Class |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
hardsty1e  |
Posted: Thursday, Jul 5 2012, 18:08
|
Rat

Group: Members
Joined: May 2, 2009

|
| QUOTE (aacclapd @ Thursday, Jul 5 2012, 14:36) | | i mean how to make a new one, i dont want another mod.besides, i dont get what file is located that code. |
just to let you know that once you have the source code/sco file, you're able to edited that script. now since you have a .vb script example of save house points that smiley gave you, logic should tell you that you can change the save point location in that script to make a new safe house coding. This post has been edited by hardsty1e on Thursday, Jul 5 2012, 19:44
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SmileyHam  |
Posted: Thursday, Jul 5 2012, 21:56
|
Peon

Group: Members
Joined: Apr 17, 2011

|
| QUOTE (aacclapd @ Thursday, Jul 5 2012, 21:29) | ok man but i have to be careful with all details because some of them are confusing anyway one more question: where is this code located? i think that in amb_savebed.sco im not wrong, am i?
Thanks @SmileyHam |
I don't think it's like that. The last lines of code in the script; "ElseIf PPos.DistanceTo(Spawncoords) < 5 Then Game.ShowSaveMenu()" This is in the script I posted. It's basically the distance away from the object which in this case is an already spawned bed from the building. So if the player position is near the object, when F is pressed the Save Menu pops up. No animation is played. Maybe you can add that on your own. ---- You can edit it to; 1. Spawn a bed. Any normal bed object. 2. When near it if F(save game key) is pressed it will play the animation of Niko sleeping. 3. Make save menu pop-up 4. Have Niko play the animation of getting up from bed NOTE: The script is outdated and might not work, never tested it with 1.0.7.0 This post has been edited by SmileyHam on Thursday, Jul 5 2012, 22:01
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SmileyHam  |
Posted: Thursday, Jul 5 2012, 23:09
|
Peon

Group: Members
Joined: Apr 17, 2011

|
Bad news. It doesn't work. Good news. I edited and now it's working.  Link is here; Majestic Hotel SafeHouseBelow are the lines that I have removed because it doesn't work with 1.0.7.0 | CODE | 'Game.LoadEnvironmentNow(Spawncoords) 'Game.LoadEnvironmentNow(LiftBottom) 'Game.LoadEnvironmentNow(LiftTop) |
Not sure what they are for. I'm guessing load the map when you spawn. But the game does that automatically. Also I'm not sure about the ' added before each function. Maybe that was causing the problem?  Anyway it works now. The script automatically teleports you to the safe house as the game starts (Might remove this) 1 problem that I've noticed for this mod. The elevator at the top is missing (because it's a separate object that must be added manually, might add this since the mod doesn't add it for you) I might fix the script up, give it animation when sitting in bed, make elevator spawn and release it (Obviously giving credit to the creator of it.) Good luck!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Limiter  |
|
GTA Modder

Group: Members
Joined: Dec 3, 2010


|
Hey man, I have been trying to do this as well using C++, but now I see that it works in VB. I read your success post.  Were you able to get Niko to sleep on the bed, save, then wake up? I know it is silly to ask this since you had an updated version and should have animations working but I want to know is it flawless in the save sequence just like saving in any of rockstar's savehouses. edit: Sorry, for hastily posting, apparently animations are not done yet, I read the script.  Hope you succeed though, since Sco alterations must require a start of a new game, I was hoping to get it to work on the scripthooks. This post has been edited by Limiter on Friday, Jul 6 2012, 07:32
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SmileyHam  |
|
Peon

Group: Members
Joined: Apr 17, 2011

|
| QUOTE (Limiter @ Friday, Jul 6 2012, 07:26) | Hey man, I have been trying to do this as well using C++, but now I see that it works in VB.
I read your success post. Were you able to get Niko to sleep on the bed, save, then wake up? I know it is silly to ask this since you had an updated version and should have animations working but I want to know is it flawless in the save sequence just like saving in any of rockstar's savehouses.
edit: Sorry, for hastily posting, apparently animations are not done yet, I read the script. Hope you succeed though, since Sco alterations must require a start of a new game, I was hoping to get it to work on the scripthooks. | No it doesn't work flawlessly. There is a problem I have no idea how you can make it so that the script when it saves the game and you reload it you spawn back at majestic. There is a function in the script that automatically teleports you to the majestic as the game starts but you can't save in other houses. Is there a way to make the script create a .txt file within game and edit it and save it to the GTA IV main directory? I save the game at the bed, then I reload it to see what happens and I respawn back at another house (Note that I removed the part where the script teleports you) Also this mod spawns a Maverick at the top of the building. Will change that to Annihilator  I think I should be able to insert an animation playing function even though I have no idea how to script. Another problem; I don't know if it bugs you people but at the room where you save your game the 2 doors at the entrance are locked, meaning when you touch them and push them you will go through but they will reset back at 0 degrees. You can't shoot them either. I'll look into that.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SmileyHam  |
Posted: Saturday, Jul 7 2012, 01:56
|
Peon

Group: Members
Joined: Apr 17, 2011

|
| QUOTE (Limiter @ Friday, Jul 6 2012, 21:27) | | QUOTE (SmileyHam @ Thursday, Jul 5 2012, 23:09) | | Anyway it works now. The script automatically teleports you to the safe house as the game starts (Might remove this) |
This part confused me, it made it seems like you got it working and the script teleports you to the majestic as the game starts. | You spawn at the safehouse you saved in game but the script automatically teleports you near the bed at majestic. Problem is that if you remove the teleporting function, if you save the game you won't spawn there. It's not possible to make that unless you make an .asi or .net script which creates a .ini file and edits it so if you save at the house it enters in the .ini file "Recent save location = Majestic, if so then spawn there, if not spawn at other recent save location"
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SmileyHam  |
Posted: Saturday, Jul 7 2012, 15:54
|
Peon

Group: Members
Joined: Apr 17, 2011

|
| QUOTE (Limiter @ Saturday, Jul 7 2012, 07:19) | Perfect man, my top priority was to write the code in C++ using Aru's Scripthook. That way, it will be a .asi.
But problem is, wouldn't the .ini file overload? For example, if it keeps writing "Recent save location = Majestic" every time you save, will the file get bigger?
Or is it just a variable that keeps changing its value? |
A variable that has it's value changed. Something like this. RecentSaveLocation = House0 House1 = Broker ---Not necessary to have this, just the coords but it keeps the script organized so you know what is what. House1Coords = (Whatever) House 2 = Algonquin House2Coords = (Whatever) ALL OTHER HOUSES = Whatever ALL OTHER HOUSES COORDS = Whatever (The name of the house along with coordinates of the bed location.) So if player has saved the game within the range of those coordinates it changes the variable RecentSaveLocation to the "house1" or "house2" ect depending which coords the player was near and the script teleports you to that save house (Only necessary for Majestic, you will spawn at other houses normally) I'll explain better if you don't understand. This post has been edited by SmileyHam on Saturday, Jul 7 2012, 15:57
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(2) [1] 2
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|