The Dink Network

Reply to Re: Unusual method for one-time events

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 9th 2013, 02:46 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Yep! Here's a simple talk counter:

void main( void )
{
  int &ednum = sp_editor_num(&current_sprite);
  int &count;
}

void talk( void )
{
  &count = editor_seq(&ednum, -1);
  &count += 1;
  editor_seq(&ednum,&count);
  say_stop("`5You've talked &count times to me.", &current_sprite);
}


The main difference with globals is that this information is attached to editor sprites. If you've used create_sprite(), this talk counter won't work, as sprites created with create_sprite() don't have an sp_editor_num().

Also, when an NPC moves from the pub to his house (due to storyline, or whatever), it'll be a different editor sprite.