Aller au contenu

Photo

How to send characters to different areas after chargen in custom campaign?


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#1
hunharibo

hunharibo
  • Members
  • 126 messages
Hi all,

I know if i extend the original campaign then i can simply do this by overriding the areas in the individual background 2da entires, but i would like to do this for a standalone module.
What event would i have to catch?

I am guessing i should run the chargen first, create a plot depending on what background got selected, then read the plot integer back and depending on what it is, set the module_area_start property to my own. Where exactly would i do that?

Any help is appreciated. Thanks.

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
I suspect this would be in your module script, in the same event block where you call chargen.

#3
hunharibo

hunharibo
  • Members
  • 126 messages
I cant find the script that reads the module's start area property and send the player there in any of the core scripts. I would like to see how its done. If it happens before chargen than i am screwed.

#4
TimelordDC

TimelordDC
  • Members
  • 923 messages
I think it would be in the MODULE START event (can't remember the exact name) where you call Chargen. Once the Chargen is called, you can get the background selected during chargen and set the appropriate plot flag or have a switch construct within that cycles through possible backgrounds and moves the party to the start waypoint in the appropriate area.

This is hypothesis though since I haven't done anything like this or tested it out.

#5
stuntpope

stuntpope
  • Members
  • 112 messages
There is an event that fires at the end of char gen. That might be the place to do it. I think MODULE_START might be too early because chargen hasn't happened yet.



I don't think it is done in the core scripts. I suspect it was a custom script for the single player campaign The code for the single player campaign will be released with the next toolset patch. Then we will see how they did it.

#6
stuntpope

stuntpope
  • Members
  • 112 messages
Another way you could do it is have a default starting area that has nothing much in it and do it in the area pre load event by moving the charcater to whatever area you want them to go to.



I thought I'd suggest this just in case changing the module start location doesn't work for some reason. I don't know why but I thought I saw something in one of the 2DAs that made me think this might have been how they did it in the main campaign.

#7
stuntpope

stuntpope
  • Members
  • 112 messages
just found this in sys_chargen CHARGEN_END event handler when using a special quickstart option

SendEventModuleChargenDone(LEVEL_OF_THE_WEEK_RESREF, LEVEL_OF_THE_WEEK_WAYPOINT);

Clearly this was done as a dev shortcut but it does indicate a way to do it maybe.

Those constants are strings for an area and location. Normally the handler calls that method with empty parameters. So I am guessing that if you leave the parameters empty then it will use the default starting location but if you pass some values then you will start there.

Modifié par stuntpope, 10 décembre 2009 - 10:13 .


#8
hunharibo

hunharibo
  • Members
  • 126 messages
I tracked that function, all it does is signal the EVENT_TYPE_MODULE_CHARGEN_DONE event with the 2 string variables specified. It is still a mystery what the single player module does when catching that event. It fires into module btw.

#9
Looy

Looy
  • Members
  • 388 messages
Just copy the 2DA's and set the starting location there. Then put them in module name/module/override, should work...

Modifié par Looy, 10 décembre 2009 - 06:27 .


#10
hunharibo

hunharibo
  • Members
  • 126 messages
In my module i would like to have starting areas based on class, not background. Well, i could reduce the number of background to match the classes, but that would include creating new backgrounds and i dont think i am up to that yet :)

#11
Looy

Looy
  • Members
  • 388 messages
But backgrounds take class into account:

ID  :  Label  :  StartArea  :  StartWP

2101    Elf, Dalish Warrior    bed100ar_forest_clearing    bed100wp_start
2301    Elf, Dalish Rogue    bed100ar_forest_clearing    bed100wp_start
2103    Elf, City Warrior    bec110ar_players_house    bec110wp_start
2303    Elf, City Rogue    bec110ar_players_house    bec110wp_start
1102    Dwarf, Commoner Warrior    bdc200ar_slums    start
1302    Dwarf, Commoner Rogue    bdc200ar_slums    start
1105    Dwarf, Noble Warrior    bdn120ar_royal_palace    start
1305    Dwarf, Noble Rogue    bdn120ar_royal_palace    start
3105    Human, Noble Warrior    bhn100ar_castle_cousland    bhn100wp_start
3305    Human, Noble Rogue    bhn100ar_castle_cousland    bhn100wp_start
2204    Elf, Mage    bhm500ar_tower_harrowing    bhm400wp_start
3204    Human, Mage    bhm500ar_tower_harrowing    bhm400wp_start

You could set all the backgrounds with Warrior in the name to use the same StartArea and StartWP

#12
hunharibo

hunharibo
  • Members
  • 126 messages
except that the script to handle that 2da information is in the single player module, not the core scripts. So in fact even if i did that, it would not work, unless i extend the single player, which is not what i want to do.

#13
Looy

Looy
  • Members
  • 388 messages
Unless you are adding custom races/classes you shouldn't need to edit the script, just the 2da. Alternatively you could copy the script and edit it like in this Tut:



http://social.biowar...rounds_tutorial