PDA

View Full Version : Another question lol


darth-me
04-28-2009, 12:47 PM
Hi all!
In my next mod I will need a certain NPC to spawn in a landing pad area only after you have found 2 Star Maps. How would I go about making this work? I don't mind having to talk to someone else to make him Spawn.
Thanks!

Qui-Gon Glenn
04-28-2009, 02:04 PM
You will need to script a conditional that checks the numeric boolean that monitors the Star Map quest.

I would like to be more helpful, but I cannot recall the boolean in question. There may be a look-up sheet for you on that...

Essentially, you need a very simple conditional -

"If my PC has completed 2 Star Maps, 'X' NPC spawns into the landing area."

However, you will either need to copy this script and add it to every landing pad, since you have no clue where your PC is when this script returns TRUE, or edit each script to call this script as a separate function. The code is small, so that is up to you - I am not sure which would be more elegant.

It will be inserted into the area's "on enter" script, and should be a fairly simple cut & paste affair after you get your code working successfully.

I would write the code for you, but I am unsure of the boolean in question - and the script to spawn an NPC is in the tut's and is simple, so you can simply add that as the outcome of your conditional returning TRUE.

happy modding, and wish i could be more helpful. good news - what you are trying to do is possible and not horribly difficult :)

darth-me
04-28-2009, 03:07 PM
Cheers.
Scripting isn't really my thing lol - too much to remember. ;)

darth-me
04-29-2009, 12:44 PM
I'm not sure exactly what I'm doing, but I found in Globalcat.2da the 2nd entry is: MAIN_PLOT . Do you reckon this is it? If so, how do I check it?

Qui-Gon Glenn
04-29-2009, 05:17 PM
I'm not sure exactly what I'm doing, but I found in Globalcat.2da the 2nd entry is: MAIN_PLOT . Do you reckon this is it? If so, how do I check it?
I would start at KSE. Look in a savegame and look at the star map quest, and the values of the numeric boolean for different advances of the quest should be there.

You will then declare an integer that represents that global, and that will be placed in the premise of your if statement, checked against the value you are looking for, specifically the value that corresponds to the 2nd planet finished in the star map quest.

then your code will be roughly this:

void main() {

int nStarmap=GetGlobalNumber("StarMapQuestBooleanName");
if nStarmap==n {
ExecuteScript "spawnyournpc";
}
}

Remember though, this script doesn't do much on it's own.... needs to be inserted into your landing pad on-enter scripts.

You do not need to declare the integer, and could condense this code by placing nStarmap inside the conditional... I wanted it to be easy to read and still functional. It may be neither :|

You will need to determine from KSE the value you want for "n"

Something along these lines will do it. As for spawning your custom npc with that "spawnyournpc", see this thread (http://www.lucasforums.com/showthread.php?t=143536). Mighty helpful stuff there!

darth-me
05-03-2009, 10:01 AM
Still stuck :p. How do i work out which script is the enter script for the Dantooine landing area? It doesn't seem to have a Dan13_enter.ncs or anything similar.

Edit: Nevermind, i've got it :)

Edit2: To test it can I load a savegame where I've already got 2 of the Star maps?

Exile007
05-03-2009, 08:45 PM
Actually, you'll need to get a save before you ever got to the landing area of Dantooine. The reason being that the on-enter script has already been fired for that area, so you'll need to get a savegame before that area (end of Taris) and then get two Star Maps. :)

R2-X2
05-04-2009, 09:53 AM
I would test it on a savegame where you've already found one map (for example tatooine), then insert the script to another planet (for examle Manaan, but only for testing if you want it on Dantooine) and then go to Manaan and find the map. You don't have to find two maps now.

Qui-Gon Glenn
05-06-2009, 12:28 PM
Let me know how your progress is going.. The advice of these folks is sound on testing procedures.

1. You want to test the mod and make sure it does NOT fire when your conditional has not returned TRUE (not having finished two maps).
2. You want to test that it fires when the conditions have been met (2 maps done).
3. Tatootine - k_ptat17_enter.ncs in the on-enter (I am a little familiar with it ;) ) - that is one spot you will need to add your script. To identify your other planet area on-enters, there is a list somewhere (I would give it to you but I have lost it, again, aargh) that tells you all of the module names and their corresponding location. Cut and paste to each landing pad area's on-enter.

darth-me
05-06-2009, 01:04 PM
By a landing pad, I mean 1 specific planet

Qui-Gon Glenn
05-07-2009, 09:58 PM
By a landing pad, I mean 1 specific planet

Ok, that is easier - which planet?

darth-me
05-08-2009, 01:19 PM
Doesn't matter, i think i've got it working now :thmbup1: