Jump to content

Modding - Using the "PlaceAtMe" command


goldredblue0798

Recommended Posts

Hey fellow gamers and modders!

 

I am looking for a script command to use with "PlaceAtMe NPCRefGoesHere"

 

But I need it to be specific on how many NPC's are placed and I need it to only place them once every 3 days or so...

 

This script will be activated when the player comes within range of the activater node in the game world.

 

-KC

Link to comment
Share on other sites

I don't really know much about scripting, but I'm learning because I'm making a similar mod, except that the activator will be on the PC..... Or at least I hope so. Anyways, from what I read in the Tutorials you have to put in a "Do Once" command line in there.

 

Edit: Nevermind. I just re-read your post. You need more than one.

Link to comment
Share on other sites

I don't really know much about scripting, but I'm learning because I'm making a similar mod, except that the activator will be on the PC..... Or at least I hope so. Anyways, from what I read in the Tutorials you have to put in a "Do Once" command line in there.

 

Edit: Nevermind. I just re-read your post. You need more than one.

 

Yeh with the script I use it places a LIMITLESS amount of NPC's all at the same damn spot and never stops...

 

What I need is for the activater to place about 5 different NPC's at the location and then wait for a few days before being able to place them again...

Link to comment
Share on other sites

Just another idea...

 

Another way to do this with even more control on the amount of NPCs is by creating all the NPCs, placing them into a holding cage and using a MoveTo command. And attach to each NPC an UponDeath command to disable them, move them back to the holding cage and resurrect them. Then they will be ready to be pulled back in when you need them. This would ensure a finite amount and avoid savegame bloat.

 

EDIT:

 

If you created 30 NPCs, your activation script could check to see how many are alive and walking around and if that number is less than you want, move another NPC into the worldspace. This would maintain a fairly consistent amount of live NPCs based on your activation sequence.

 

LHammonds

Link to comment
Share on other sites

Just another idea...

 

Another way to do this with even more control on the amount of NPCs is by creating all the NPCs, placing them into a holding cage and using a MoveTo command. And attach to each NPC an UponDeath command to disable them, move them back to the holding cage and resurrect them. Then they will be ready to be pulled back in when you need them. This would ensure a finite amount and avoid savegame bloat.

 

EDIT:

 

If you created 30 NPCs, your activation script could check to see how many are alive and walking around and if that number is less than you want, move another NPC into the worldspace. This would maintain a fairly consistent amount of live NPCs based on your activation sequence.

 

LHammonds

 

Sounds kinda complicated...

 

Care to post an example script please?

Link to comment
Share on other sites

Just another idea...

 

Another way to do this with even more control on the amount of NPCs is by creating all the NPCs, placing them into a holding cage and using a MoveTo command. And attach to each NPC an UponDeath command to disable them, move them back to the holding cage and resurrect them. Then they will be ready to be pulled back in when you need them. This would ensure a finite amount and avoid savegame bloat.

 

EDIT:

 

If you created 30 NPCs, your activation script could check to see how many are alive and walking around and if that number is less than you want, move another NPC into the worldspace. This would maintain a fairly consistent amount of live NPCs based on your activation sequence.

 

LHammonds

 

Could you make it so that the script would pull out random NPCs? Say 3 of the 50, but each time it would be a different set?

 

 

Golden, here's where some good info about that type of scripting can be found:

http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Summoned_Creatures

Link to comment
Share on other sites

Just another idea...

 

Another way to do this with even more control on the amount of NPCs is by creating all the NPCs, placing them into a holding cage and using a MoveTo command. And attach to each NPC an UponDeath command to disable them, move them back to the holding cage and resurrect them. Then they will be ready to be pulled back in when you need them. This would ensure a finite amount and avoid savegame bloat.

 

EDIT:

 

If you created 30 NPCs, your activation script could check to see how many are alive and walking around and if that number is less than you want, move another NPC into the worldspace. This would maintain a fairly consistent amount of live NPCs based on your activation sequence.

 

LHammonds

 

Could you make it so that the script would pull out random NPCs? Say 3 of the 50, but each time it would be a different set?

 

 

Golden, here's where some good info about that type of scripting can be found:

http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Summoned_Creatures

 

Has some use but that info is not for Fallout 3 and wont function fully with the GECK...

 

Also when I use the "MoveTo" command the GECK seems to not recognise the command alot of the time plus it seems to have a bunch of other problems....

 

Will stick with trying to make "SpawnAtMe" command work by making it so only a few NPC's are spawned...

Link to comment
Share on other sites

MoveTo works like this

 

RefID01.MoveTo RefID02

 

RefID01 is the object being moved, whether it's a creature, npc, static, item, etc. Anything that can have a reference ID.

 

 

RefID02 is the location they will be moved to, whether it's the player, an Xmarker, again, anything that can have a reference ID. The difference here is, if it's an object then the RefID01 will be placed inside of it... which is why it's best to use an XMarker or XMarkerHeading.

 

 

PlaceAtMe creates savegame bloating. It's best to avoid the command as much as possible.

Link to comment
Share on other sites

MoveTo works like this

 

RefID01.MoveTo RefID02

 

RefID01 is the object being moved, whether it's a creature, npc, static, item, etc. Anything that can have a reference ID.

 

 

RefID02 is the location they will be moved to, whether it's the player, an Xmarker, again, anything that can have a reference ID. The difference here is, if it's an object then the RefID01 will be placed inside of it... which is why it's best to use an XMarker or XMarkerHeading.

 

 

PlaceAtMe creates savegame bloating. It's best to avoid the command as much as possible.

 

Yeh I know about that save game bloating issue its fricking annoying since it laggs the game and maybe even causes game crash...

 

I am still trying the "MoveTo" command however... but it seems to be VERY bugged and I would have to write countless references and over a hundred scripts just to get npc's to spawn to each and every marker...

Link to comment
Share on other sites

The Summoned Creatures tutorial is exactly what I had in mind as an example. Obviously you would need to tailor it for your own needs but as already mentioned, you could place several Xmarkers to move these NPCs.

 

Creating the NPCs, the references, the "creature cage" and such should be fairly easy but the the complicated part will be the handling of the variables...keeping track of which / how many NPCs are alive as well as where to move them to (so you don't spawn 5 NPCs in the exact same spot at the same time).

 

If you can create a function that accepts a parameter, that would be the cleanest way to do something like this. But you could just go through each of the NPCs one at a time and count how many are disabled. Once you have the grand total, do some math to find out how many need to be moved and enabled. Then it is a matter of randomizing which ones are moved. If there is a randomize number function, maybe you could use that to have it pick a number between 1 and 50...then take that number and see if the corresponding NPC is disabled...and then move him and decrement the variable that says how many you need to re-activate. This assumes you name your NPC references something like mynpc1, mynpc2, mynpc3, etc. and that you can pull a reference with a partial name + a variable. Otherwise you would have to make a long If Then, Else that checks the variable and issues the correct command.

 

I'm sorry I don't have any code to show you. I don't have FO3 installed anymore and I never really used the GECK...but from what I saw, it was very similar to the TES CS...at least in functions.

 

I also hope I'm not over-complicating this...I tend to program based on pseudocode first and after I get a working model, I then cut away to make it more efficient based on the language used and functions/features available.

 

LHammonds

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...