Aller au contenu

Photo

Romance ELEGIBILITY Script Question


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

#1
Church0071

Church0071
  • Members
  • 44 messages
Hi Everyone! :)
 
I am VERY new to the wonderful world of scripting (as you will probably be able to tell from my question haha! =]), in fact this is my first scrip that ISN’T about adding an item :pinched:. The problem that I have is at some point AGES ago in game I chose a dialogue option (Asking about what changes when you become a Grey Warden -> “Just try that line on me” -> “Fine, keep them to yourself”) which permanently killed Alistair’s romance eligibility – aka no “You look handsome :wub:” etc. initiators and NO WAY to start the romance as by this time in game I have already used up any romance-initiating specific conversations such as the Chantry one etc. I re-loaded that save and tested before and after it with and without using that particular dialogue and I am sure THAT “Fine, keep them to yourself” LINE was the one to cut off the romance eligibility. Anyhow, I am now trying to rectify this problem by adding a script Posted Image. I have the following one:
 {

string sVar = GetLocalString(GetModule(),"RUNSCRIPT_VAR");

int nFind = FindSubString(sVar," ");

string sArea = SubString(sVar,0,nFind);



//DEBUG_PrintToScreen("Adding " + sXp + " XP to " + ToString(OBJECT_SELF));

//RewardXPParty(nXp, 5, OBJECT_SELF, OBJECT_SELF);

Approval_SetLoveEligible(APP_FOLLOWER_ALISTAIR,TRUE);

Approval_SetFriendlyEligible(APP_FOLLOWER_ALISTAIR,TRUE);

Approval_ChangeApproval(APP_FOLLOWER_ALISTAIR, 100);

Approval_SetRomanceActive(APP_FOLLOWER_ALISTAIR,TRUE);

WR_SetPlotFlag(PLT_GENPT_APP_ALISTAIR, APP_ALISTAIR_ROMANCE_ACTIVE, TRUE, TRUE);

WR_SetPlotFlag(PLT_GENPT_APP_ALISTAIR, APP_ALISTAIR_MAKE_LOVE, TRUE, TRUE);



if(Approval_IsRangeValid(APP_FOLLOWER_ALISTAIR, APP_ROMANCE_RANGE_LOVE, TRUE))

DisplayFloatyMessage(GetHero(), "wot", FLOATY_MESSAGE, 16777215, 20.0);



DisplayFloatyMessage(GetHero(), "WORKS", FLOATY_MESSAGE, 16777215, 20.0);

}



BUT this is for activating the romance straight up.Posted Image What I want to do is NOT activate the Romance itself BUT activate the Romance Eligibility aka “LoveEligible” so that Alistair is friendly Posted Image but there is the OPTION to romance him (which seems to be impossible using console commands Posted Image). SO as far as I know the script is correct up until “Approval_SetRomanceActive(APP_FOLLOWER_ALISTAIR,TRUE);”. Will everything still work if I just change the “TRUE” to a “FALSE” for that one? ALSO What do I do about the rest of the script because I am really confused by the bits below that line. Posted Image
 
Thanks for your time and any help is GREATLY (OH MY GOSH Posted ImageSO MUCH lol) appreciated lol!

#2
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
I don't know how the romance logic works, but here is an idea... Maybe it is triggered by the approval value. So, since you are setting it to 100 (which I suppose is the maximun value), then it is activated inmediately. Try to set it to 0.

#3
Church0071

Church0071
  • Members
  • 44 messages
Thanks for the suggestion L_o_B_o_ Posted Image Unfortunately I tried this already (probably should have mentioned that lol Posted Image D’oh!) and no matter what the disposition score is the romance eligibility is still off. So it must be an independant factor Posted Image. SO I guess my question now is: How can I change this script so that it turns on the romance eligibility but DOESN’T activate the romance? I really have no idea! Posted Image But thanks for the help so far Posted Image

#4
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
Have you tried to remove this line:



WR_SetPlotFlag(PLT_GENPT_APP_ALISTAIR, APP_ALISTAIR_MAKE_LOVE, TRUE, TRUE);



????

#5
Church0071

Church0071
  • Members
  • 44 messages
Yes, I tried taking out all lines referencing Alistair love or activating the romance Posted Image. So now the script looks like this:
 
 {

string sVar = GetLocalString(GetModule(),"RUNSCRIPT_VAR");

int nFind = FindSubString(sVar," ");

string sArea = SubString(sVar,0,nFind);



//DEBUG_PrintToScreen("Adding " + sXp + " XP to " + ToString(OBJECT_SELF));

//RewardXPParty(nXp, 5, OBJECT_SELF, OBJECT_SELF);

Approval_SetLoveEligible(APP_FOLLOWER_ALISTAIR,TRUE);

Approval_SetFriendlyEligible(APP_FOLLOWER_ALISTAIR,TRUE);

Approval_ChangeApproval(APP_FOLLOWER_ALISTAIR, 100);


}
 
BUT Posted Image I’m having trouble making it compile as I’m getting an error that whatever I name the script (In this case AlistairEligible) is an “Invalid Declaration Type” Posted Image so the compile fails. Maybe I’m doing something wrong in the setting up? All I did was open the Toolset go to File -> Manage Modules and set it to Single Player. Then I chose File -> New -> Script and named my script – leaving all of the sections below at default. Am I making some n00by mistake here, perhaps? Posted Image Ack! Posted Image

#6
Church0071

Church0071
  • Members
  • 44 messages
Whoops! Posted Image Double Post! Sorry! Posted Image

Modifié par Church0071, 02 septembre 2010 - 01:23 .


#7
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
Could you post the whole script (with includes and all)?

In Manage Modules, have you created a new module or have you opened the existing Single Player campaign? I think the cleanest way to run you script is as an addon to the Single Player, so you should create a new module and select Single Player as extended module.

Modifié par _L_o_B_o_, 02 septembre 2010 - 11:32 .


#8
Church0071

Church0071
  • Members
  • 44 messages
“Includes”? I don’t understand Posted Image (Sorry, my English is not so great! Posted Image). If you mean the whole script, that’s in the first post. Is that not complete? Posted Image Ah, I was just using the Single Player Campaign! I’ll try making an addon module now. Fingers crossed! Posted Image

#9
Church0071

Church0071
  • Members
  • 44 messages
Ack! Posted Image It is still saying that whatever I name the resource is an “Invalid Declaration Type” whenever I try and save the script. Here is what I did to make my new module (I am going by this tutorial for the first part about making a new module, the rest is about making items so it's a bit irrelevant Posted Image - http://dragonagemodd...player-an-item/):
I went to File -> Manage Modules -> New. In the “Module Properties” window I named my module, gave it a UID (unique identifier) and then set the “Extended Module” as “Single Player”. I then opened my new module and in “Hierarchy” I selected “Single Player”. Next, I selected File-> New -> Script. I named my new resource the same thing as my module, like in the tutorial (so that shouldn’t be causing a problem Posted Image), and then I changed the “Module” to “Core Game Resources” (this is what was done in the tutorial…but that’s for making a weapon so…I’m not sure… Posted Image?) and the “Owner Module” to my new module. I then put my script in and tried to save and...the rest is history! Posted Image
I hope that all makes sense and wasn't TOO boring Posted Image lol. HEY, if you know any good “How to create a new script” type of tutorials that would probably also help Posted Image. I have looked but I can’t seem to find any for just making a basic bit of script! Posted Image

Modifié par Church0071, 02 septembre 2010 - 01:38 .


#10
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages

Sorry, my English is not so great!


Mine is even worse. Elementary english I learned at school and watching tv shows xD

Here is the most basic script that will compile without errors (it does nothing):

The main function is where the script starts execution.

void main()
{
}


If you don't have any good reason to keep those 3 first lines of your script, I would remove them.

So, at first glance, your script would look like this:

void main()
{
   Approval_SetLoveEligible(APP_FOLLOWER_ALISTAIR,TRUE);
   Approval_SetFriendlyEligible(APP_FOLLOWER_ALISTAIR,TRUE);
   Approval_ChangeApproval(APP_FOLLOWER_ALISTAIR, 100);
}


But here you are using some functions and constants that have not been declared before. What's the value of APP_FOLLOWER_ALISTAIR? Where is the definition of the Approval_SetLoveEligible() function? That's why you use "includes". Those constants and functions are defined in another script: approval_h. So, you just have to include that file at the beginning of your script.

#include "approval_h"

void main()
{
   Approval_SetLoveEligible(APP_FOLLOWER_ALISTAIR,TRUE);
   Approval_SetFriendlyEligible(APP_FOLLOWER_ALISTAIR,TRUE);
   Approval_ChangeApproval(APP_FOLLOWER_ALISTAIR, 100);
}


This should compile correctly.

HEY, if you know any good “How to create a new script” type of tutorials that would probably also help


I think the wiki is the first place you should check for this kind of help.

Modifié par _L_o_B_o_, 02 septembre 2010 - 05:47 .


#11
Church0071

Church0071
  • Members
  • 44 messages
Haha! I’m learning English by watching TV too! Posted Image It might not be the BEST way but it sure is the most fun. Posted Image
Thank you SO MUCH for all of your help with the script Posted Image (and sorry for not replying for a few days – I was away with my family and the hotel had NO internet connection!! Posted Image I nearly died lol) The script compiled perfectly and I ran it in in game and got Alistair’s approval to 100 instantly so I knew it worked BUT there was still no romance option Posted Image. Then I started reading through the wiki and I found out that the line:

Approval_SetLoveEligible(APP_FOLLOWER_ALISTAIR,TRUE);
ISN’T actually what makes the romance eligible Posted Image (that line is used for if you are ALREADY in a romance and want to make it possible to go from Adore to Love without doing his personal quest – which is what is normally the trigger for this transition). SO I decided to have a look at the Conversations section in the toolset and I found that the line I chose which seemed to end all romance options triggers this Action:

Plot: genpt_app_ alistair

Flag: APP_ALISTAIR_ROMANCE_CUT_OFF
It seems that THIS line is responsible for stopping the romance Posted Image, so I tried to find it in scripting Functions (where I found Approval_SetFriendlyEligible ect.) in order to set it to FALSE but I had no luck until I looked under constants and found the line APP_ALISTAIR_ROMANCE_CUT_OFF.

Now my problem is that I don’t know how to set it (a Constant) to false without causing errors and I can’t find anything on the wiki dealing with this sort of thing Posted Image.

P.S I am incredibly grateful for all of your help!! Posted Image
P.P.S Your English seems fine to me! Posted Image

Modifié par Church0071, 05 septembre 2010 - 03:21 .


#12
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
You cannot change the value of a constant. That's why they are called "constants". But, APP_ALISTAIR_ROMANCE_CUT_OFF stores the name of a flag, not its value (TRUE or FALSE). What you need to do here is change the value of the flag.

To do so use the WR_SetPlotFlag() function:

WR_SetPlotFlag(PLT_GENPT_APP_ALISTAIR, APP_ALISTAIR_ROMANCE_CUT_OFF, FALSE);

Don't forget to add the following includes at the beginning:

#include "wrappers_h"
#include "plt_genpt_app_alistair"

Modifié par _L_o_B_o_, 05 septembre 2010 - 10:08 .


#13
Church0071

Church0071
  • Members
  • 44 messages
Thank you SO MUCH! Posted Image It worked perfectly! Posted ImageYou have NO IDEA how frustratingly close I got to your script after working on it for a while by myself lol! Posted Image I guess maybe this means I'm becoming slightly less n00by at scripting after all. I really couldn't have done it without your help, though! So thanks thanks thanks thanks thanks thanks and thanks again!!! Posted Image

#14
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
It is good to know that you tried it by yourself... It is usually more frustrating and takes more time, but you learn a lot of things by the way. That's the spirit! xD