Aller au contenu

Photo

What is wrong with this?


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

#1
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
Hi, I recently began using the toolset. I know nothing of C++ language or so. I'm barely making anything by looking at the tutorials but even tutorials sometimes are not noob friendly. Anyway here's problem...

void main()
{                     
    if(WR_GetPlotFlag("grey_warden_officer_q", GREY_WARDEN_SOLDIERS)==FALSE)
    {
        object oTown = GetObjectByTag("lot110ar_chantry");
        vector vOfficerLocation = Vector(4.18272f, -8.27397f, 0f);
        CreateObject(OBJECT_TYPE_CREATURE,R"grey_warden_officer.utc", Location(oTown, vOfficerLocation, 0f));
        WR_SetPlotFlag("grey_warden_officer_q", GREY_WARDEN_SOLDIERS, TRUE);
    }
}

Whatever I do, toolset cannot compile because it doesn't have right "bracket" on the expression on "if" statement. I barely followed the official "adding creatures in the existing maps" guide  posted by Craig(?) from BIOWARE and Toolset Wiki thing. If anyone has better script or know how to fix it, please help!

#2
Magic

Magic
  • Members
  • 187 messages
When I compile your script, I encounter other errors. Is it the complete script? 0f needs to be 0.0f, and I think you're missing a custom include file where GREY_WARDEN_SOLDIERS is defined. Maybe a
#include "plt_grey_warden_officer_q"
at the beginning? I'm assuming you created a plot "grey_warden_officer_q" yourself.

Modifié par Magic, 30 décembre 2009 - 02:57 .


#3
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
I thank you for your reply, I will try that to see if that fixes things.Posted Image

#4
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
Damn!Posted Image It still says that "if" statement is wrong because it doesn't have "right brackets"

#5
Magic

Magic
  • Members
  • 187 messages
That's why I'm wondering if you posted the entire script. I copy&paste the lines from your first post, and there's no bracketing mismatch for me!

#6
Mengtzu

Mengtzu
  • Members
  • 258 messages
Try expressing it as



if (!(WR_GetPlotFlag(PLT_MY_PLOT, MY_PLOT_FLAG))) {



}



It's a lot of brackets, but it should work. BTW, why are you using a string for your plot rather than just passing the constant? It should be available if you're #including the plot.

#7
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
Thank You, Mengtzu.

P.S1 Hmm, I don't think it matters but, my toolset version is 1.01008.0. May be this version has bracket issues? 'Cause I did some searching and no one in this forum seems to have same issue, so might be defecting on Vista or just my system.

#8
Craig Graff

Craig Graff
  • Members
  • 608 messages
Since you don't seem to have answered, I'll ask too: "Is that the entirety of your script?"

#9
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
Yes, in fact it is, at least according to that accursed Toolset Wiki's How-to section says so.
EDIT: I think I found something that is working but it doesn't spawn my guys when I enter the area. I have to spawn it with runscript command.

Modifié par AnnoyingDisplayName, 30 décembre 2009 - 04:24 .


#10
Magic

Magic
  • Members
  • 187 messages
Ah now at least I know which script you're referring to. Those lines from the wiki are an excerpt as well. They wouldn't compile either, lacking includes for plot and wrapper functions.



I avoided dabbling with 2DAs so far, but I think this How-To is using them.

#11
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
That wiki is cursed!

#12
Jopon

Jopon
  • Members
  • 17 messages
if(WR_GetPlotFlag("grey_warden_officer_q", GREY_WARDEN_SOLDIERS)==FALSE)



try



if(WR_GetPlotFlag("grey_warden_officer_q", GREY_WARDEN_SOLDIERS)==FALSE);



:)

#13
Craig Graff

Craig Graff
  • Members
  • 608 messages

Jopon wrote...

if(WR_GetPlotFlag("grey_warden_officer_q", GREY_WARDEN_SOLDIERS)==FALSE)

try

if(WR_GetPlotFlag("grey_warden_officer_q", GREY_WARDEN_SOLDIERS)==FALSE);

:)


In most c-based languages, this would be the same as removing that line entirely, since you are following a conditional immediately with the blank statement ";" causing the bracketed statements to always execute. In DAscript this just results in the following compiler error:
   If condition cannot be followed by a null statement

I've updated the How-Tos page to be slightly more usable.

It sounds like the problem you are having is with the PRCSCR file not being exported properly.

Try social.bioware.com/wiki/datoolset/index.php/2DA for a bit more info.

Modifié par Craig Graff, 01 janvier 2010 - 05:41 .


#14
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
Happy New Year! And bless you all. Also Thanks!

#15
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
By the way, my question that is still un-answered. Is there any way to use that "AddNonPartyFollower"? I've been try to use "bhn200ar_castle_after_siege" script's part and "bhn200cr_cousland_follower" script. I've been studying it for hours to figure out what makes NPCs follow me around as a "NonPartyFollower". Any tips on that?

Modifié par AnnoyingDisplayName, 01 janvier 2010 - 06:58 .