Aller au contenu

Photo

debug request


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

#1
Baracuda6977

Baracuda6977
  • Members
  • 353 messages
a simple debug check to see if my PRCSCR_ file fired off, but i am getting a 'parsing variable list (8)' error :

#include "wrappers_h"
#include "plt_goron_plot_v1"

void main()
{        
      int plflag = WR_GetPlotFlag("goron_plot_v1", 2, FALSE)

      if (WR_GetPlotFlag("goron_plot_v1", 2, FALSE) == 1)
        {
       oPlayer = GetMainControlled():
   DisplayFloatyMessage(oPlayer,"plot flag set", FLOATY_MESSAGE, 16777215,10.0);
       }
       else {
       oPlayer = GetMainControlled():
   DisplayFloatyMessage(oPlayer,"plot flag NOT set", FLOATY_MESSAGE, 16777215,10.0);}
}

line 8 is the IF statement
goron_plot_v1 is the name of my plot holding flag 2 which whas supposedly set in the PRCSCR script i made

can anyone help?

#2
Phaenan

Phaenan
  • Members
  • 315 messages
If goron_plot_v1 is the name of your plot resource, you may access its plot ID constant with PLT_GORON_PLOT_V1. So your function call should be like WR_GetPlotFlag(PLT_GORON_PLOT_V1, 2, FALSE). :o

#3
Baracuda6977

Baracuda6977
  • Members
  • 353 messages
JESUS, look at all the SYNTAX ERRORS HOW DID I MISS THAT

edit: its working...

this isn't :
#include "wrappers_h"
#include "var_constants_h"

void main()
{
    object oPlayer = GetMainControlled();
    object oMerc = UT_GetNearestObjectByTag(oPlayer, "goron_orz_v1");
    if (IsObjectValid(oMerc)){
    int mrkup = 90;
    SetStoreMarkUp(oMerc,mrkup);}
}

this is SUPPOSED to make all of his goods sell at 90% actual price
goron_orz_v1 is the name of my merc object

Modifié par Baracuda6977, 15 février 2010 - 03:18 .


#4
Magic

Magic
  • Members
  • 187 messages
Does the script actually execute? My first typical "sanity check" for new scripts is

AddCreatureMoney(1,GetHero());

You could use the logging function instead, of course. ^^ Please also add a check into the if-block.

#5
Baracuda6977

Baracuda6977
  • Members
  • 353 messages
wouldnt that effectually be the same as DisplayFloatyMessage()?



also, i have no clue how to use the logging crap

#6
Magic

Magic
  • Members
  • 187 messages
Yes, it's only a debug help to see if code at that point is executed at all. It's not a "proper" method I guess. ^^ As someone pointed out nicely though (and I wasn't aware of it at that time) spamming DisplayFloatyMessage() will result in not all messages shown. So the message display is good for retrieving current values but not reliable for checking script execution if you need to use the display often.