How to teleport a Pawn to a random map location?

Discussions about Coding and Scripting
Baak
Novice
Posts: 5
Joined: Fri Nov 22, 2024 6:00 am

How to teleport a Pawn to a random map location?

Post by Baak »

I have a Mutator to get Bots out of "limbo" which happens every once in a while on certain maps and when using certain other Mutators.

The only way I was able to get them to "restart" so far is by using:

Code: Select all

Pawn.GotoState('Dying');
I could not get Pawn.RestartPlayer() or Pawn.ClientRestart() to work, but I am not 100% happy with GotoState('Dying')... It works, but I what I would really prefer is to teleport the pawn/player to a random map position with all their weapons/inventory/health intact.

Is there a way to do this?

I tried digging into the Relic of Redemption, but am unsure how to pull the .uc file(s) out of the relics.u file - a pointer to this would also be great! :D

Thank you in advance!
Buggie
Godlike
Posts: 3229
Joined: Sat Mar 21, 2020 5:32 am

Re: How to teleport a Pawn to a random map location?

Post by Buggie »

Just use some Navigation node for that.

Relics spawn in that way.

You can open sources of packages in UnrealEd and explore them.

User avatar
sektor2111
Godlike
Posts: 6443
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to teleport a Pawn to a random map location?

Post by sektor2111 »

"SwarmSpawn" was capable to help me in some points... because I adjusted it a little bit.
I was using temporary a decoration added on a said "random node" for figuring if a creature can be there or not, and to not spawn them behind walls due to certain type of maps - mutator was borked not the map...

Yes... Bot used in map should go in stage "dying" - in order to start match correctly and to be initialized with the right jump capability and not just thrown in map hitting "save" button and it's all "awesome". The same it's for any mutator doing that.
Baak
Novice
Posts: 5
Joined: Fri Nov 22, 2024 6:00 am

Re: How to teleport a Pawn to a random map location?

Post by Baak »

Thank you both - Will dig into this a little more.

With UnreadEd, it is crapping out on my Windows 10 install. Going to try re-installing on a dedicated Windows box from my original CD's ;)
Buggie
Godlike
Posts: 3229
Joined: Sat Mar 21, 2020 5:32 am

Re: How to teleport a Pawn to a random map location?

Post by Buggie »

You need use UnrealEd latest version. 469d as for now. It run great on modern systems. Original UnrealEd not stable and not perform great.
Baak
Novice
Posts: 5
Joined: Fri Nov 22, 2024 6:00 am

Re: How to teleport a Pawn to a random map location?

Post by Baak »

Thank you! It suddenly dawned on me after I posted that I was likely using a broken install (I'm using a Macbook with Windows installed on a VM so have the 469d patch installed on the Mac and was trying to run the old UnrealEd on my 2008 Windows install...)

I installed the 469d patch on Windows and was able to fire up UnrealEd - cool! I also found https://unrealarchive.org/unrealscript when looking for UTPT (which I could not find) and that is one cool website. I love how all you good people have kept something so great alive through all the changing O/S's and hardware - THANK YOU ALL! :D

I unpacked Relics and can see how the Relic of Redemption works to randomly relocate a Pawn. Now I have something fun to work on over the weekend! ;)

Cheers and thanks again,
Baak