collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Using the console to trigger the same map change as the game uses.  (Read 1022 times)

Offline Norrwin

  • Ancillus
  • ***
  • Posts: 170
  • Reputation: +2/-0
The original question was how to transition from Warrens 4 to Warrens 5 so I will use that as an example because it is useful.

Entering the following commands in the console will transition to the original starting point for the map same as dropping down into the water would:

Code: [Select]
__main__.FindEntitiesByClass("trigger_changelevel")[0].SetName("test")
__main__.ChangeMap(2,"Warrens5", "test")

If the patch you are using changes the number or order of trigger_changelevel entities then you may have to change the 0 in the first line till it matches what it is in the new patch. But in 10.8 is it still 0 so I doubt it has changed. In my case there were only two entities, index 0 was unnamed and index 1 was named Warrens4_Teleport so I knew it was index 0.

Spoiler for Map entities:
{
"model" "*5"
"classname" "trigger_changelevel"
"map" "hw_warrens_5"
"landmark" "Warrens5"
"spawnflags" "0"
}
{
"model" "*6"
"classname" "trigger_changelevel"
"spawnflags" "0"
"map" "hw_warrens_3"
"landmark" "Warrens4"
"targetname" "Warrens4_Teleport"
}

This method is based off the command:

Code: [Select]
__main__.ChangeMap(float delay, string trigger_changelevel_landmark, string trigger_changelevel_targetname)

All you need is to go into "...\Patch_Extras\Developer Tools\Level Entity Lists" directory and open the relevant map file and search for trigger_changelevel entries or look at the map directly using VPK Tool. If the entity already has a targetname then you can skip the first command and go directly to the second line and replace "test" with whatever your entities targetname is. The entity will always have a landmark entry though.

If it doesn't have a targetname entry, like this example, the first line is needed to give it one. In this case I choose the name test (any random name you want). You will also need to find the correct entity index by randomly trying them so if there are 4 trigger_changelevel entities then you will need to try 0,1,2, and 3 in the index field until you find the correct one. For starters if it were the third entry in the BSP I would try index 2.

Offline Malkav

  • Antediluvian
  • *****
  • Posts: 1963
  • Reputation: +396/-13
Re: Using the console to trigger the same map change as the game uses.
« Reply #1 on: August 20, 2021, 08:45:10 am »
If there are several unnamed trigger_changelevel entities on the map, the name of the landmark should help identifying the right one. Even if the name is not descriptive you can find an info_landmark with the same name on the targetmap.
Co Author of Camarilla Edition Mod

Offline Norrwin

  • Ancillus
  • ***
  • Posts: 170
  • Reputation: +2/-0
Re: Using the console to trigger the same map change as the game uses.
« Reply #2 on: August 20, 2021, 05:12:01 pm »
If there are several unnamed trigger_changelevel entities on the map, the name of the landmark should help identifying the right one. Even if the name is not descriptive you can find an info_landmark with the same name on the targetmap.
You will always know which one it is in the BSP but you need to know which index it is in the console command list:

__main__.FindEntitiesByClass("trigger_changelevel")
[<?.Entity instance at 1BE580C4>, <?.Entity instance at 1BE57F5C>, <?.Entity instance at 1BE583DC>, <?.Entity instance at 1BE57FA4>, <?.Entity instance at 1BE57DAC>, <?.Entity instance at 1BE57E3C>, <?.Entity instance at 1BE57C8C>, <?.Entity instance at 1BE57FEC>, <?.Entity instance at 1BE5810C>, <?.Entity instance at 1BE57CD4>, <?.Entity instance at 1BE58424>, <?.Entity instance at 1BE58CDC>, <?.Entity instance at 1BE58DB4>, <?.Entity instance at 1BE58C04>, <?.Entity instance at 1BE58664>, <?.Entity instance at 1BE58544>, <?.Entity instance at 1BE58DFC>, <?.Entity instance at 1BE585D4>]

Which is why I said "For starters if it were the third entry in the BSP I would try index 2." because it does appear the console command list order is the same as the order in the BSP. But since I don't know that to be a fact I can only say in the few instances I have tried that is true.

 

SimplePortal 2.3.7 © 2008-2022, SimplePortal