Player Function

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Player Function

Postby SimonDenton » Thu Apr 12, 12 12:29 pm

Hey guys,

Nice and simple problem today. We have the function in DeusExPlayer:
exec function GoalAdd( Name goalName, String goalText, optional bool bPrimaryGoal ).

When I put in something like Player.GoalAdd('KitchenGoal', "Get me a sandwich", True); there is an error that says bad or missing parameter 1.

I tried something different:

Code: Select all
function Timer()
{

local DeusExGoal goal;
local Name goalName;
local string goalText;

if(Flags.GetBool('Ready'))
{
goalName = 'KitchenGoal';
goalText = "Get me a sandwich";
goal = Player.AddGoal(goalName, True);
goal.SetText(goalText);
}
}


But walking into a flag that set 'Ready' in a test level didn't get the goal up.

How is the goal function not working?
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Alex » Thu Apr 12, 12 12:38 pm

Try debugging a bit: Does your code actually pass the if clause? (So was the bool/flag properly set?)

Also, did you activate the Timer() function? (by SetTimer)

Code: Select all
function Timer()
{
local DeusExGoal goal;
local Name goalName;
local string goalText;

if(Flags.GetBool('Ready'))
{
Log("Ready!", 'DEBUG');
goalName = 'KitchenGoal';
goalText = "Get me a sandwich";
goal = Player.AddGoal(goalName, True);
goal.SetText(goalText);
Log("GOAL DEBUG:"@goal, 'DEBUG');
}
}
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby SimonDenton » Thu Apr 12, 12 1:03 pm

Thanks for the prompt reply Alex!

I actually simply forgot to put in Super.Timer(); after the variables. It works!

Thanks for your help Alex! But still, what is wrong with the Player.GoalAdd function?
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Alex » Thu Apr 12, 12 1:31 pm

GoalAdd is a 'cheat', so to say. So you have to enable cheats in order to use it.
Code: Select all
exec function GoalAdd( Name goalName, String goalText, optional bool bPrimaryGoal )
{
   local DeusExGoal newGoal;

   if (!bCheatsEnabled)
      return;

   newGoal = AddGoal( goalName, bPrimaryGoal );
   newGoal.SetText( goalText );
}
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby SimonDenton » Thu Apr 12, 12 2:13 pm

Weird...AddGoal() doesn't work either. I thought burden's Goal Add Trigger used those functions.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Alex » Thu Apr 12, 12 5:32 pm

Have you debugged it though? Did that give you any information on where it stops?
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby SimonDenton » Wed Apr 18, 12 6:28 am

Yeah it doesn't seem to work but my current mission script method will do.

Thanks for the assistance!
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 10 guests
cron