Quantcast

Jump to content

» «
Photo

[Q] Adding a Save Point?

11 replies to this topic
Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • None

#1

Posted 02 January 2009 - 02:12 AM

As the title says

Anach
  • Anach

    Square Civilian

  • Members
  • Joined: 21 Dec 2008

#2

Posted 02 January 2009 - 02:46 AM

Would be nice to be able to have a quick save. So one could save at any point. Which I cant see why all games dont have this day and age.

L0uNGeR
  • L0uNGeR

    Ya, that's what I said.

  • Members
  • Joined: 03 Dec 2008

#3

Posted 02 January 2009 - 03:07 AM Edited by L0uNGeR, 02 January 2009 - 03:16 AM.

from used_natives_params.txt
CODE
ENABLE_SAVE_HOUSE=2, False
REGISTER_SAVE_HOUSE=6, True


from main.sco:
CODE
  G[9943][var0 * 11].v1 = REGISTER_SAVE_HOUSE(var4.v0, var4.v1, var4.v2, var7, var8, var13);
  ENABLE_SAVE_HOUSE(G[9943][var0 * 11].v1, 1);


Ofcourse the savehouse to register must exist.
So what needs to be created would be a new savehouse-spot and trigger.

Also in main.sco, this seems to be the part that creates all the savehouses:
CODE
void sub_9641()
{
  sub_967f(0, 898.7668f, -504.9684f, 13.9801f, 892.4379f, -499.8047f, 18.4023f, 187.9549f, "sh*tholerm", 0, 29);
  sub_967f(1, 594.8668f, 1400.904f, 9.9578f, 601.4458f, 1409.836f, 16.5333f, 220.3219f, "bronxsaveroom01", 1, 29);
  sub_967f(2, 112.7246f, 847.0318f, 13.711f, 99.2167f, 851.6819f, 44.0459f, 89.8429f, "loftrm1", 2, 29);
  sub_967f(3, -963.105f, 896.9019f, 12.6766f, -969.6779f, 887.0903f, 18.0012f, 189.3049f, "JersSaveApt", 3, 29);
  sub_967f(4, -419.0942f, 1487.036f, 17.8599f, -426.0058f, 1463.95f, 37.9664f, 13.2491f, "PlayXroom", 2, 29);
}

void sub_967f(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10)
{
  auto var13, var14, var15, var16, var17, var18, var19, var20, var21, var22, var23, var24;

  if (var0 > 5)
  {
      sub_5d6b("Main_Missions: Store_Save_House(): Illegal Save House ID");
  }
  if (((!(G[9943][var0 * 11].v2.v0 == 0.0f)) || (!(G[9943][var0 * 11].v2.v1 == 0.0f))) || (!(G[9943][var0 * 11].v2.v2 == 0.0f)))
  {
      sub_5d6b("Main_Missions: Store_Save_House(): Save House ID already setup");
  }
  G[9943][var0 * 11].v2.v0 = var1.v0;
  G[9943][var0 * 11].v2.v1 = var1.v1;
  G[9943][var0 * 11].v2.v2 = var1.v2;
  G[9943][var0 * 11].v5.v0 = var4.v0;
  G[9943][var0 * 11].v5.v1 = var4.v1;
  G[9943][var0 * 11].v5.v2 = var4.v2;
  G[9943][var0 * 11].v9 = var10;
  G[9943][var0 * 11].v10 = var9;
  var13 = var9;
  G[9943][var0 * 11].v1 = REGISTER_SAVE_HOUSE(var4.v0, var4.v1, var4.v2, var7, var8, var13);
  ENABLE_SAVE_HOUSE(G[9943][var0 * 11].v1, 1);
  G[9943][var0 * 11].v0 = 1;
}

Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • None

#4

Posted 02 January 2009 - 03:25 AM

I'm confused, can you please give me just the code that triggers a save point? Then can you tell me how to add one, I mean co-ordinations

L0uNGeR
  • L0uNGeR

    Ya, that's what I said.

  • Members
  • Joined: 03 Dec 2008

#5

Posted 02 January 2009 - 03:29 AM

It's not that easy.
Besides, REGISTER_SAVE_HOUSE expects one string (var8) and we can't push strings yet.

Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • None

#6

Posted 02 January 2009 - 03:30 AM

QUOTE (L0uNGeR @ Jan 2 2009, 03:29)
It's not that easy.
Besides, REGISTER_SAVE_HOUSE expects one string (var8) and we can't push strings yet.

Right, thanks

L0uNGeR
  • L0uNGeR

    Ya, that's what I said.

  • Members
  • Joined: 03 Dec 2008

#7

Posted 02 January 2009 - 04:47 AM

Also, checkout
common\data\cdimages\script.img\ambsavebed.sco

r3df0x
  • r3df0x

    Player Hater

  • Members
  • Joined: 29 Dec 2008

#8

Posted 02 January 2009 - 09:17 AM

Would be cool to have the first savehouse back!
Or Jimmy House...OO ... with full working garage... biggrin.gif

Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • None

#9

Posted 02 January 2009 - 09:40 AM

QUOTE (L0uNGeR @ Jan 2 2009, 04:47)
Also, checkout
common\data\cdimages\script.img\ambsavebed.sco

How?

sjaak327
  • sjaak327

    Big Homie

  • Feroci Racing
  • Joined: 01 Dec 2008
  • None

#10

Posted 02 January 2009 - 11:08 AM

You need openIV, then open the script.img in that program and you willl see all the sco's that are part of this file.


Andrew
  • Andrew

  • Inactive Staff
  • Joined: 21 Jul 2003
  • None

#11

Posted 02 January 2009 - 11:27 AM

Please use posting tags, and please don't just use the title as the post...

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#12

Posted 25 October 2013 - 11:12 AM

resurrection in 3, 2, 1...

 

never is too late  :evilgrin: 

i discovered how to do this:

Dim tmpSafeHouseAux As Native.Pointer = New Native.Pointer(GetType(Int32))
tmpSafeHouseAux.Value = 2

Dim tmpSafeHouse As Int32 = Native.Function.Call(Of Int32)("REGISTER_SAVE_HOUSE", towerRestorePoint.X, towerRestorePoint.Y, towerRestorePoint.Z, 274.23, "IMIV", tmpSafeHouseAux)

Native.Function.Call("ENABLE_SAVE_HOUSE", tmpSafeHouse, True

but we need to create an activator (position + keypress check for example) to bring the save game window calling:

Native.Function.Call("ACTIVATE_SAVE_MENU")

obs.: 274.23 is the player heading, "IMIV" is a custom string that i used to replace one of the found in SCO files, dont know if works with one of those strings
Be carefull with the position, dont change it after using the save game method, game can crash if the new save position is different from the saved one

you can see this code in action here:

 

http://www.facebook....411925215597091





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users