The Dink Network

Reply to Re: How do i make it so i can pick up gold

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 10th 2005, 01:39 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Generally this is done via the script emake.
You can put one of these line in a sprites void die() procedure.
external("emake","small"); //for small hearts
external("emake","medium"); //for a low amount of gold, food, small heart or a large heart.
external("emake","large"); //for a high amount of gold, food or a large heart
external("emake","xlarge"); //for a large heart or a really large sum of money

What you get when running one of these procedures is randomly determined.

If you want to manualy determine the amount of money dropped by a sprite try putting this in the void die() procedure:

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
int &golda = create_sprite&save_x,&save_y,0,178,3);
sp_script(&golda,"lgold");
//(you could actually also use mgold, 1gold, gold200 or gold500 for this, but I chose lgold for this example)

If you also want to excactly determine the amount of gold given to the player, copy lgold from the source folder and edit it as you like.
You should probably replace these lines:

int &mcrap = random(25,50);
&gold += &mcrap;
say("I found &mcrap gold.",1);

with:

&gold += *the amount of money you want to give the player*;
say("I found *the amount of money you want to give the player* gold.",1);