Have you ever seen this command?

xdiesp

Spy
Joined
Nov 23, 2004
Messages
724
Reaction score
1
this command doesn't exist. BUT! Is there one that works the same?

"IF map 1 THEN load 1"

it's a command that makes you load a savegame instead of loading a level! I need it and I'm going insane.
 
I need this to pass from savegame to savegame; if the autoexec way is not possible,maybe someone could help me spawning a new (mod?) kind of entity that execs,triggered,the command "load 1"
 
You could probably definately code something to do it. It's pretty flexible.
 
while I study the SDK docs,I hope somebody will pop up yelling "I already did it,here it is!" and then peace will be all over the world.
 
Heh very doubtful, if you are looking for easy answers like that you should probably try editing HL.
 
I've been looking a lot into the docs but can see no real way to have a trigger/entity load a savegame...damn...
 
super moderator Dark Elf,I hope you're still there. They told me to look at the Point_ClientCommand in Client.cpp . I found that this is a command to add personalized commands,as having you dropping your P90 in CS if you're too ahead of games won. Now I have to rewrite the "blank" version of this command to suit my needs: having "load 1" in some part of the level so that when I arrive there,if triggers. Even having it when starting a new stage would be enough. Do you remember anything about this command? Here's its lines:

class CPointClientCommand : public CPointEntity
{
public:
DECLARE_CLASS( CPointClientCommand, CPointEntity );
DECLARE_DATADESC();

void InputCommand( inputdata_t& inputdata );
};

void CPointClientCommand::InputCommand( inputdata_t& inputdata )
{
if ( !inputdata.value.String()[0] )
return;

edict_t *pClient = NULL;
if ( gpGlobals->maxClients == 1 )
{
pClient = engine->PEntityOfEntIndex( 1 );
}
else
{
// In multiplayer, send it back to the activator
CBasePlayer *player = dynamic_cast< CBasePlayer * >( inputdata.pActivator );
if ( player )
{
pClient = player->edict();
}
}

if ( !pClient || !pClient->GetUnknown() )
return;

engine->ClientCommand( pClient, UTIL_VarArgs( "%s\n", inputdata.value.String() ) );
}

BEGIN_DATADESC( CPointClientCommand )
DEFINE_INPUTFUNC( FIELD_STRING, "Command", InputCommand ),
END_DATADESC()

LINK_ENTITY_TO_CLASS( point_clientcommand, CPointClientCommand );

I have to figure what to change in here to get what I'm searching for. Thank you dark elf!
 
much simpler: use the entity playerloadsaved in combination with logic entities.
 
Mr Neutron: I know I'm noob...please,could you give me some simple directions to accomplish that? I don't really understand all of this,God knows if I'd like to...

As of now,I can spawn your entity with:
give player_loadsaved
Then give it a name with ent_setname and show it on screen with:
developer 1 and ent_name.

How can I instruct it to do something when I walk over it?
I know this tutorial for managing logical entities: http://www.valve-erc.com/srcsdk/Code/Logical/LogicEntity.htm
 
there are various entities beginning with logic_ that do things like fire outputs upon certain conditions. It's a matter of connecting inputs and outputs in the right way. So you'll include a playerloadsaved (which loads the last autosave), and connect to it from some logic entity which checks for the right conditions. Depending on the type of conditions, you may not need any logic entities (for instance, you could set up 2 different trigger boxes, one which loads one game, another that loads a different one).

The problem is I think you're restricted to loading the autosave. Could you tell us exactly what purpose loading a game is for?

If you need an entity that loads a different save game than the autosave, it's probably easiest to modify the playerloadsaved
 
> Could you tell us exactly what purpose loading a game is for?

sure! I'm releasing,one by one,all the original levels edited by the console spawning commands. Now they have more action. I do so by generating savegames: but,when a player completes a level and proceeds further,the game loads the original following *map*. Instead of the following *save*,that's it.

As always I'll present what you said me to a couple others to find out how to do it in the pratical way,I really can't figure the passage from theory to pratice here -___-

> If you need an entity that loads a different save game than
> the autosave, it's probably easiest to modify the
> playerloadsaved

in-game in the console or changing some .cpp file? As of now,I've tried spawning player_loadsaved in game with "GIVE player_loadsaved",then add give it an output. I wrote:

ent_fire mytriggername "load 1" player,touch,1,0,-1

but it didn't work. The addoutput instructions were:

<output name>
<targetname>:<inputname>:<parameter>:<delay>:
<max times to fire (-1 == infinite)>
 
ok, I don't know anything about using the console to spawn things but I DO know that the entity is called "playerloadsaved" NOT "player_loadsaved". I typed it that way the first time for a reason :) Other than that, I don't know how to help with what you're doing.

EDIT: oh, I get what you're trying to do now. That's pretty clever, but wouldn't you have to distribute the savegames with this "mod"?
 
Maybe you can edit a the old levelchange entity, or kill it and spawn a new one. But how would you know the name of the trigger that does this if you don't have the original map file?
 
well,I guess I could find the spot where the trigger is,then go into developer 1 and start ent_name-ing the ground nearby to find it! I'll try this and be back with news as soon as possible.

Yes,I distribute the mod with the savegames as well: they can be individually loaded by a modded "New Game" menu with 37 entries (each level)
 
I can see the trigger_changelevel on screen,since I can't use Hammer to view its name I can only strongly assume it is d1_eli-d1_town For what I get,this trigger selects the next map on a list. It uses the imput CChangelevel and selects maps: maybe if I change CChangelevel in something else load-related,it would start loading savegames with the same name of those maps. Do you know which imput should I put?

this is all really difficult to me,if you think I'm not getting what you are saying,just order me a string without explain :p
 
all right,since last time I edited successfully my trigger.cpp to make savegames load at changelevel. However,I need now somebody who's able to compile the .cpp file to work in Half-Life2! People say I need .NET 2003 / M$ Visual C++
If anyone in here knows how to do this,please notify me and he'll be the first in the Credits list of my Half-Life 2:Substance mod,right after God,the Country and Family
http://xdiesp.altervista.org/index.html
 
as you may remember,I was searching for a way to make changelevel load savegames instead of maps and then how to recompile the triggers.cpp that its istructions of changelevel: all is done.

However a new problem has arised: there are two places in the game where backtracking to a previous level is necessary,and this screws the changelevel-savegames mechanism. In fact if I play savegame 24,then complete it and go to savegame 25,then complete it and GO BACK to savegame 24 (in the original it was "map 24") I'll be playing the wrong version of 24.

Possible solutions are:
1. customize via the console the output of the changelevel trigger in 25 that returns you to 24.sav,to have it select "24b.sav"

2. create a new entity,based on player_loadsaved but that makes you load 24b.sav instead of quick.sav

if someone knows how to do it (console command maybe?) please help! The Half-Life 2:Substance mod is in need! http://xdiesp.altervista.org/index.html
 
there is more than just a kind of changelevel,I.E. there' trigger_once that not resistable by noclip and only works once. The changelevel triggers can be enabled or disabled by typing in the console "ENT_FIRE triggername ENABLE/DISABLE" or created with "GIVE TRIGGER_CHANGELEVEL",however in the latter one,if I don't specify a map to load before,a message of error appears stating "can't find landmark,doesn't have a maptrigger_changelevel"
 
Back
Top