Jump to content

What am I missing in this script?


Deleted2746547User

Recommended Posts

I have a script that sends a brahmin with a guard from one place on the map to another after a certain quest is triggered... the problem I am having is that I can't get the brahmin to drop "off" the supplies at the player's base (a container) at the base and then turn around and head back. And then do the cycle again every so many days.

 

Any suggestions or pointers?

Edited by Guest
Link to comment
Share on other sites

From a layman's standpoint, I understand what you're saying. The problem is from a modder's standpoint you have provided zero technical explanation of what you are currently doing. So with that in mind, I'll suggest you use the script function AddItem when the brahmin is at the container to simulate the drop off. Then you set a quest variable that the brahmin's "return to base" AI package checks to see if it should go back. Then when that package is complete (i.e. the brahmin is back to it's start point) set another quest variable in the End script tab for the package that tells the brahmin to wait. The quest script has a gamemode block which checks for that variable, starts a wait timer and resets the variable so the brahmin doesn't wait forever. When that timer finishes, send the brahmin back to the container.

 

When someone provides a clear description of what they are doing it is easier for others to provide feedback. Otherwise getting all the necessary details is like trying to pull teeth, and very few have the patience for that.

 

I've provided my feedback, now I'll step aside and leave it open for others.

Link to comment
Share on other sites

Again, I wanted to thank you both for responding. My problem is I really have never "gotten" scripting.. I have an idea of what I want to do, but even though the coding is simple for people who "get it".... I really don't. And I am lucky that I happen on a few good scripts that I can make work.

 

In any event, what I was trying to do with this one script is:

 

1. I have brahmin set up to travel back to one place on the map. I've done this with x marker patrols. Check, that works out fine (except for them occasionally getting "stuck" along the way.)

2. When they finally "arrive" at the destination, I want them to "drop off" their supplies to a container. So, a brahmin coming from the Saltworks would drop off salt when he makes it (and pick up cash or supplies) for the return trip, the brahmin coming from a Ranch would drop off meat, etc. What is important about this "additem" only happening when each brahmin physically makes it to that point on the map is that raiding by opposing factions on supply lines will be important in the mod. And give importance to Quests related to protecting your convoys.

 

I've tried trigger scripts but i can't seem to make any work that apply to each brahmin convoy individually when he makes it to your base. (so the salt brahmin would need to deliver salt, not meat or metal, etc.)

 

I will look more at your suggestions. THANK YOU

Link to comment
Share on other sites

I don't think you need trigger scripts. You are already using patrols, which can have their own result script (on the patrol data tab for the xmarker). You can also put scripts on the AI package for end and begin.

 

Without getting too specific, you can use

mybrahminref.removeallitems mycontainerref

To dump all of the brahmin's stuff into whatever container you like. Just pick which patrol marker/leg of AI package is most appropriate for what you are trying to accomplish.

Link to comment
Share on other sites

Q - you are a man for all seasons! Question. Would you do the reverse when he makes it "back" to the starting marker. that is, have a script run that adds new items to the brahmin before he makes the trip again?

 

I don't think you need trigger scripts. You are already using patrols, which can have their own result script (on the patrol data tab for the xmarker). You can also put scripts on the AI package for end and begin.

 

Without getting too specific, you can use

mybrahminref.removeallitems mycontainerref

To dump all of the brahmin's stuff into whatever container you like. Just pick which patrol marker/leg of AI package is most appropriate for what you are trying to accomplish.

Link to comment
Share on other sites

If that is what you want to happen, yeah, you could probably do the opposite. Never tried it personally but I would guess that's how the casino scripts work when they take your stuff and then give it back.

 

mycontainerref.removeallitems mybrahminref

 

Try it and see what happens.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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