@Maniac Modeler
He answered that before I saw your post.
He is right; I included that destroy script as an example for creating such an effect.
You can make different ones for different amounts and then assign them accordingly.
So, as an example, here is the script included with the parts that need to be changed in bold....
Quote: "
;Artificial Intelligence Script by Conjured Entertainment
;Header
desc = Add 100 Cash Then Destroy
;Triggers
:state=0:settargetname=cs1,state=1
:state=1:plrsound=$0,globalvar=1,incvar=100,activatetarget=13,state=2
:state=2:state=3,destroy
;End of Script
"
So if you wanted $3,687 cash for killing something then you would make it like so...
Quote: "
;Artificial Intelligence Script by Conjured Entertainment
;Header
desc = Add 3687 Cash Then Destroy
;Triggers
:state=0:settargetname=cs1,state=1
:state=1:plrsound=$0,globalvar=1,incvar=3687,activatetarget=13,state=2
:state=2:state=3,destroy
;End of Script
"
Now save that as
destroy3687.fpi and then assign it to the entities destroy script.
It is that easy.
Quote: "then all you need to do is update the HUD file that shows how much you made "
I used a HUD in the pickup scripts (
pickupcash1k.fpi, etc), but I did not even use one for the destroy script.
You could add one in easy enough though, and you can look at the pick up scripts for an example.
Quote: "If I wanted to add in a new variable would I create six new entites (like your paintings) with slightly modded versions of the scripts running (i.e. to display the new variable along side where cash is displayed in the HUD? "
You could, but you don't need all six scripts unless you want to display six digits.
Since your hides and furs will probably be limited to what a person could carry, then two digits would probably suffice.
You see the first three of the six scripts break down the variable.
Each scripts determines the value of two digits then it moves to the next script.
So, after going through the 3 scripts we have determined each of the six digits values.
I needed each digits value because the numerals are only 0-9, so that way the same ten images will work for whatever number of digits you need.
The last three scripts simple apply the value back to the variable so we end up back at our original value.
So, if you needed a four digit number for the hides, etc, then you could work out a 4 script system that would be compatiblle with the same numerals used for the cash display.
Two script to read the value and two scripts to restore it.
Now, lets take that a step further, and look at a value of only two digits like 0-99.
That would be even easier and managable in a single script because we wouldn't need to break the number down.
We could simply have 100 lines of a single state that would read the exact value and display the right two huds.
However that script would be pushing the line limit, but I think it could be squeezed in.
My multiple timer system uses a two digit display with a single script because that example limits the value to 0-30.
I think the two digit system would work for your hide/meat project, because the player can't carry but so many around anyway.
That way they would be forced to make the trip to sell every now and then. (when their pack is full (99))
The variable could hold higher values but the display would be capped at 99.
So if they had 105 hides, then they would have to sell at least 7 of them to see the counter drop below 99.
You could of course limit this in the pickup script for the hides/meat by not allowing a pickup if the value is greater than 98.
I recommend making most items for player inventory to be double digits with a single script.
If you cap them at 50 instead of 99 for less line count, then two items could be displayed with one script using the straight forward technique.
Lower limits on the item number allowable enables even more items displayed with each script, and that way you won't get too many scripts running just to display values.
When you consider that 4 or more different items can be done with four scripts when using double digits, then it sounds better than having 4 scripts for one item that has 4 digits.
Hope that helps
Edit
Also, plan ahead.
I was so excited to finally have the variables in FPI that I started right away on my cash system. (I had been waiting for those variables)
The mistake I made was not planning the use of my global variables better.
I should have used higher numbers so the variables would not conflict with other scripts.
That is why I opted to use global variables 70-75 for the multiple timers script.
So, it isn't a bad idea to make a list of the global variables that you want to use for your projects ahead of time to avoid conflicts later.