Author Topic: Variable Events  (Read 1286 times)

No, no. It's not VCE.

I'm trying to figure out how to make events similar to VCE, but the variable is already set and cannot be altered.

What I want it to be, is

OnTrigger<Client<IfMoney<___
ifMoneyValid<___<___
ifMoneyInvalid<___<___


Here is my pathetic attempt, basically because I stole snippets of code from AddItem and VCE.
Code: [Select]
registerOutputEvent("Player", "AddItem", "datablock ItemData", "Money" 1);

function Player::addItem(%player,%image,%client)
{
for(%i = 0; %i < %player.getDatablock().maxTools; %i++)
{
%tool = %player.tool[%i];
if(%tool == 0)
{
if (%money = Money)
{
%player.tool[%i] = %image;
%player.weaponCount++;
messageClient(%client,'MsgItemPickup','',%i,%image);
break;
else
{
return;
}
}
      }
    }
}

function fxDtsBrick::ifMoneyValid(%brick,%client)
{
$inputTarget_Self = %brick;
$inputTarget_Player = %client.player;
$inputTarget_Bot = %brick.vehicle;
$inputTarget_Client = %client;
$inputTarget_Minigame = getMinigameFromObject(%client);
if(%client.money=>Money);
%brick.processInputEvent("ifMoneyValid",%client);
}
function fxDtsBrick::ifMoneyInvalid(%brick,%client)
{
$inputTarget_Self = %brick;
$inputTarget_Player = %client.player;
$inputTarget_Bot = %brick.vehicle;
$inputTarget_Client = %client;
$inputTarget_Minigame = getMinigameFromObject(%client);
if(%client.money<Money);
%brick.processInputEvent("ifMoneyValid",%client);
}

I probably shouldn't be helping you but just know that adding money is as simple as
%objthatmoneyisstoredon.money += %amount;
also your syntax is wrong but it's a good start.

I probably shouldn't be helping you but just know that adding money is as simple as
%objthatmoneyisstoredon.money += %amount;
also your syntax is wrong but it's a good start.

Yes you probably shouldn't, but I always enjoy your input :) But I still need to know how to put it into events.
« Last Edit: May 14, 2011, 03:44:39 PM by ::Matt:: »


There are like 5 or 6 very basic concepts to scripting that you clearly do not know, broken in your script.

functionality-wise, none of it is correct

syntax wise, it starts to break here:
    if (%money = Money)

What are you trying to do with this?  You don't have a good explaination, and your code makes no sense at all.

You obviously don't know what the script is for. I even said it's something I just threw together so people knew what I was aiming for if they somehow didn't understand the bluntly obvious description of what I want, which apparently flew over your head.

Use these in basic integer comparison syntax.

A single "=" is for setting a variable specifically to an integer or string.

Code: [Select]
>=
<=
==

You obviously don't know what the script is for.

Good.  You read exactly what I wrote.

I even said it's something I just threw together so people knew what I was aiming for if they somehow didn't understand the bluntly obvious description of what I want, which apparently flew over your head.

Moron, this is your entire description:

I'm trying to figure out how to make events similar to VCE, but the variable is already set and cannot be altered.

What I want it to be, is

OnTrigger<Client<IfMoney<___
ifMoneyValid<___<___
ifMoneyInvalid<___<___


-snip90%stolen10%brokencode-

Just reading that, it looks like you are testing whether or not the person has valid money, but that doesnt match up with any of the code you posted.

There is no "obvious description" there.  If you want help, be more clear about what you want to accomplish.  Otherwise, the only thing people can help you on is basic syntax.

::Matt::, you appear to not know what you're doing.

Elses are not inside of the if.

You did the input events wrong.

If statements don't have semicolons.

hope i helped c:

Alright, read the topics in this board, starting with "(Lesson 1) Variables" and "(Lesson 3) Conditional Statements".
http://scatteredspace.com/forum/index.php?board=16.0

For further reading, go here. I'd recommend reading "Introduction to Syntax" and "Operators and Variables" first.
http://forum.blockland.us/index.php?topic=146136.0

::Matt::, you appear to not know what you're doing.

Hence the "Coding Help" topic.

There is no "obvious description" there.

Everyone else seemed to know what I was getting at.

You people don't seem to understand what the code is for. The only reason I put the code there, even though I knew there were many flaws with it, is because if I didn't, it would be considered a suggestion, which isn't what I want it to be.

I am grateful for all those who are actually helping me instead of finding reasons to bitch about how the code isn't perfect in a topic about getting help with the code.

Hence the "Coding Help" topic.

Everyone else seemed to know what I was getting at.

You people don't seem to understand what the code is for. The only reason I put the code there, even though I knew there were many flaws with it, is because if I didn't, it would be considered a suggestion, which isn't what I want it to be.

I am grateful for all those who are actually helping me instead of finding reasons to bitch about how the code isn't perfect in a topic about getting help with the code.


Ok, read carefully stupid, or you might miss everything again.

No one but me has made a single post about what they think your code does except for

::Matt::, you appear to not know what you're doing.

Seriously, both your code and your brief "description" are confusing.
All the help here has been about your syntax.  No one knows what it is supposed to do.  Ignoring the code altogether, this is what I have to go by:

No, no. It's not VCE.

I'm trying to figure out how to make events similar to VCE, but the variable is already set and cannot be altered.

What I want it to be, is

OnTrigger<Client<IfMoney<___
ifMoneyValid<___<___
ifMoneyInvalid<___<___


ALL this tells me is that you want some mysterious output event and two mysterious input events.

I do not know why you are comparing this to VCE, please explain.

I do not know whether or not your "IfMoney" test is testing whether the client has money, whether they have a certain amount, or some combination of different possibilities.

Your ifMoneyValid/ifMoneyInvalid is extremely confusing, because that tells me nothing about what you are trying to test.  What do you mean by "valid money"?  Are you testing whether or not they have an invalid type of money, like a foreign currency?  That is what invalid money means.

Please take the time to type out an actual description before you claim that everyone understands what you are talking about and that what you want to do is "obvious", instead of putting in a tiny snippet of wrench event, and a long block of misleading code.
« Last Edit: May 15, 2011, 09:16:59 PM by Nexus »

Nexus, you're being really stupid.

OnTrigger<Client<IfMoney<___
ifMoneyValid<___<___
ifMoneyInvalid<___<___
"I want it like VCE"

GEE I WONDER WHAT IT COULD BE

1) Use VCE
2) Make a special "money" variable
3) ???
4) Profit

No confusing scripting necessary.

Nexus, you're being really stupid.

OnTrigger<Client<IfMoney<___
ifMoneyValid<___<___
ifMoneyInvalid<___<___
"I want it like VCE"

GEE I WONDER WHAT IT COULD BE

I'm not being stupid.  I see no clear explaination on what that is.  I don't know what it means if the money is "valid" or "invalid" and what kind of test "ifmoney" is.  He basically is asking the forum to make the code for him, and all he really knows is what to put into the wrench events gui.