Score problem..,

Started by PrimitiveUser, Mon 08/12/2008 20:50:08

Previous topic - Next topic

PrimitiveUser

Hey again  ::), just like how you can have a if (player.activeinventory == bla blah blah.
with the else blah blah blah.

:-*, can you have the score like that cause the score is the money in my game, and when you purchase a item,
if you dont have score/money then you cannot by something thats the else thingy.
can u do that tell me the code dont say rtfm and all the other crap, thanks  :=.

Ghost

#1
Header: I am not a mod. I do not wish to pretend to be one. If I come over too harsh, take it witch a pinch of salt.

primitiveuser- In order to "not get the crap", you should make an attempt to at least write down coherent questions. There's little sense saying "then you cannot do the else thingy". I think I understand what you want, but with such a lax mishmash of a post I feel not too inclined to answer. I fear others will think like me, too.

If you wish to use your score as "money" to do stuff, you can, obviously, write stuff like "do stuff, then more".

Is that the sort of answer you'd like to get?

But well:
If then else- a simple structure that allows you to do something when a condition is met, and something else when not. You can also "nest them", and they work with any value.

Code: ags

if (condition)
{
  // any code here
}
else
{
  // any code here
}


You can write these if then else statements into any interaction. Let's say you have an item to buy, then this would work:

Code: ags

if (player.score >= 100)
{
  player.Say("It's 100 coppers, but I can afford that!");
  player.addInventory(iSword);
  player.score-=100;
}
  else
{
  player.say("It's 100 coppers, I do not have that money!");
};


This allows your player to buy a sword item for 100 "score" IF he has a score of 100 or higher, and also makes him lose that amount of score. If the player hasn't got the score/money, he will say so, and not buy the item.

PrimitiveUser

I can tell that your a complete ...

I shouldn't expect help from you anymore why? Because I've re-edited your crap you told me.., RTFM!

{
if (game.score >= 100)
{
  Display("You have purchased an Iron Axe.");
  player.AddInventory(iaxeiron);
  game.score-=100;
}

You really need to start reading up man.., But thanks for giving me the "IDEA," Lol.

Ghost

#3
So, tell me, I am a complete what? And try to use some proper words, lad. Try to act your age. By the way, that's spelled "you are", or "you're". Heh, newbies today.

And oh, yeah, thanks for editing my crap. I see I mistyped a command there. Now I wonder: Why did you, with your apparently vast knowledge of AGS, post in the first place? And what's that superfluous curly bracket for?

I'd love to let off some more steam, but I think I'd rather not bother. You showed me the light. I'll leave the forums right away and start life as a hermit.

Pumaman

Quote from: primitiveuser on Mon 08/12/2008 22:19:10
I can tell that your a complete ...

I shouldn't expect help from you anymore why? Because I've re-edited your crap you told me.., RTFM!

Ok, that's enough. The minimum age on these forums is 16. If you are unable to act that age, please refrain from posting.

Dualnames

WTF? I mean WTF? primitive..rather evolve..Ghost has a huge fan base, and we're all bloodthirsty and villainous..and we eat cookies with milk as well!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

suicidal pencil

Primitive, there is no need to be overly pedantic.

Now that we've chastised him, I think we should just move on.

Dualnames

that wasn't the point i think, but well Ghost was actually pretty kind and tried to be helpful instead of bragging. And primitive didn't respect that,
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

PrimitiveUser

first of all im 17 years old n second of all i type fast so i dont use proper grammer and mayb ei was a little mean and i didnt respect ghost..
Im sorry ghost that you cannot script properly.... you shudnt be a hermit you should work for google.com they gotta nice company running
but im glad you know where ur heading to ghost.

sorry all foe the trouble ill make sure ghost dusnt make mistakes and i did say thanks for the idea..................

Ghost

#9
Sorry to everyone to return to this, but really, that's it. I'm a patient man, but this is it.

[rant]
QuoteI'm 17 years old n second of all i type fast so i dont use proper grammer and mayb ei was a little mean and i didnt respect ghost..
Well, first of all we have many 17-year-old fast typers, and several of them can user proper grammar, even though English isn't their first language. No excuse, none at all, get it?

QuoteIm sorry ghost that you cannot script properly
Who are you to determine my scripting skills? He?

Quoteshudnt be a hermit
Apparently you have no sense of irony. Get that fixed, it helps a lot. And your punctuation too.

Quotesorry all foe the trouble ill make sure ghost dusnt make mistakes and i did say thanks for the idea..................
Telling me I'm a complete... and fixing my crap... is not saying thanks, escpecially not with a crude LOL after it.

Make a game, then pipe up again.

[/rant]

Okay, that's it. Sorry, I know it's probably the wrong place, but this needed saying.
Delete if inappropriate.

I'm out.


[edit] some strong language removed

Gilbert

Alright, primitiveuser, listen to Pumaman, again. If you are unable to act mature enough and insist on being primitive so not post here, until you calm down a bit and are able to think before you post. (* Reaching the minimum age requirement is different from being able to act accordingly. We do have members who do not meet the age requirement but could act maturely.)

SMF spam blocked by CleanTalk