PlanetVampire.com Forum

Vampire the Masquerade: Redemption => Redemption Modding => Topic started by: Apocalypse on June 24, 2013, 09:36:12 pm

Title: question about cash on a player
Post by: Apocalypse on June 24, 2013, 09:36:12 pm
is there any way to use the cash on a player as a variable so you can subtract or add to the value they have.. when you do a spell or click on a object like a prop??
Title: Re: question about cash on a player
Post by: Javokis on June 25, 2013, 12:46:27 am
There is a way to add cash to the player by dropping it as an item, but there's no practical way to call up the player's cash in the Java API. Best thing to do is to bring up a shop interface for all transactions involving taking cash from the player - it's the only way to be sure the right person is giving the right amount of cash. Club Abla actually has an example of giving cash to the players through a conversation, but that's the most practical way of doing it.
Title: Re: question about cash on a player
Post by: Apocalypse on June 26, 2013, 03:51:10 am
awe ok thats cool so much for my vending machine idea unless you have free machines lol
Title: Re: question about cash on a player
Post by: Signothorn on June 26, 2013, 04:33:07 am
Would there be a way to edit the not file to make a vendor take the form of an object with no voice?
Title: Re: question about cash on a player
Post by: Javokis on June 26, 2013, 04:53:24 pm
No. The voice is controlled by the java script that initiates the vendor interface. You would have to edit the script, or make a slightly altered new script that doesn't have voice calls.
Title: Re: question about cash on a player
Post by: Apocalypse on June 30, 2013, 05:11:17 am
you could set a variable couldnt you likefor a prop when its clicked it adds +1 to a variable and when it reaches a certain number it does something.. cause if you did do like a free machine or something that give something you could set the props value to a certan number and if it was clicked past that many times it would say that the machine was out? or heck you could even take a machine that exchanged blood or health when you clicked it for a item so it would tech be free lol just throwing that out there
Title: Re: question about cash on a player
Post by: Apocalypse on June 30, 2013, 05:17:59 am
meant wouldnt be free lol
Title: Re: question about cash on a player
Post by: Javokis on June 30, 2013, 05:31:00 am
Yes... that would actually be quite a simple script to make.
Title: Re: question about cash on a player
Post by: Javokis on June 30, 2013, 05:44:50 am
here, I'll throw you a bone

Code: [Select]

public class PopMachine extends Codex
{

     private int numItems = 10;

     public void clicked(int guid, int clickerGuid, int captureID){

          CodexActor clicker = new CodexActor(clickerGuid);

          if(numItems > 0 && clicker.GetActorStat(ACTOR_STAT_BLOOD) >= 10)
          {
                  numItems--;

                  //give player something
                  clicker.SpawnThing("item");
             
                   //take blood
                  clicker.AddActorEffectByValue("ef_decreaseblood", 0, -10, 0, 0);

                new CodexSound("bigBox_pickup.wav", 300, 600, 100, 0, 0, GetClassThing());
          } else {
                //do nothing.... or print fail... or make a sound... oh for crying out loud...

                new CodexSound("digitalBleep_05.wav", 300, 600, 100, 0, 0, GetClassThing());
          }
    }
}
Title: Re: question about cash on a player
Post by: Apocalypse on July 01, 2013, 03:01:45 am
good deal  thanks i might look into this and see hat i can do  with it... maybe  design some graphics if you or anyone wanted to impliment them in md maps
SimplePortal 2.3.7 © 2008-2020, SimplePortal