"Parameter type does not match prototype" Error when using pointers [SOLVED]

Started by shamz, Thu 11/02/2016 14:24:27

Previous topic - Next topic

shamz

I wrote a custom function intended to add an Inventory item to the player while also notifying that the item has been added.

Code: ags

function Notify(InventoryItem*item){ //not the best function name but I'll change that later
  AddedInv.Text = item.Name;
  player.AddInventory(item);
  gNotification.Transparency = 100;
  gNotification.Visible = true;
  while (gNotification.Transparency >= 10){
    gNotification.Transparency -= 10;
    Wait(1);
  }
  gNotification.Transparency = 0;
  WaitMouseKey(1000);
  while (gNotification.Transparency <= 90){
    gNotification.Transparency += 10;
    Wait(1);
  }
  gNotification.Visible = false;
}


In the header of GlobalScript I imported the function like this:

Code: ags

import function Notify(InventoryItem);


However, when I run the game I get this error:
Parameter type does not match prototype

Now I am new to using pointers and I don't have a lot of experience writing my own functions. I'm guessing I imported the function wrong or I used pointers incorrectly.

Khris

Use this:
Code: ags
import function Notify(InventoryItem*item);

shamz


SMF spam blocked by CleanTalk