• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

I think Jass is required..help plz

Status
Not open for further replies.

BenQuick

B

BenQuick

So, I want to set variable with potential function, like in case of interests in bank. But World editor doesnt support ^ function (potential function) so i dont know what to do. I heared of Jass but i dont know how it works, what it is..
I would be grateful if you post what can i do!
 
@Dr_Super_Good: WaterKnight mentioned the GUI action in his post as well.

@BenQuick: If you want some method of interest rates for a banking system in game, you should try to avoid using the power function - it takes a lot of processing power.

I'm guessing you want to make somthing like a TD that gives 10% additional gold to savings every round.

In that case, in your newRound trigger, add:

set player gold = playerGold*1.1 or something similar.

In the case that you actually want compouding interest, you'll also need to start a timer on initialization that records how much time has passed in game.

Cheers and good luck!
 
well, i actually made it this way: You put -gd X (x=gold u want to deposit) and -gt Y (y=time you want gold is deposited).
Time actualy influences on rate of interrests so i cant ignore it. I made timers too and i think i all works, the problem is that somethink is wrong with variables, because i have error:



function Trig_deposit_gold_time1_Actions takes nothing returns nothing
set udg_deposittimeR[GetConvertedPlayerId(GetTriggerPlayer())] = S2R(SubStringBJ(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString())))
endfunction

//===========================================================================
function InitTrig_deposit_gold_time1 takes nothing returns nothing
set gg_trg_deposit_gold_time1 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_deposit_gold_time1, Player(0), "-dt", false )
call TriggerAddCondition( gg_trg_deposit_gold_time1, Condition( function Trig_deposit_gold_time1_Conditions ) )
call TriggerAddAction( gg_trg_deposit_gold_time1, function Trig_deposit_gold_time1_Actions )
endfunction
 
We need the line number and error discription to help.

@BenQuick: If you want some method of interest rates for a banking system in game, you should try to avoid using the power function - it takes a lot of processing power.

Yes it does take a lot of processing power, but you can still do it millions of times a second. It also should have an order complexity of near O(1).

Do not think its method of opperation gets covered in math class. Although Maclaurin series could be used for example they are far too slow. Instead power, log and trig functions use a combination of lookup tables, corrections and tricks (stuff that somehow just works and hard to prove how) to improve their execution efficency.

Additionally, processors have special hardware in them to speed up the execution of such functions although whether JASS compiles to use them is another question.
 
Errors were fixed, but...

In my condition i cant put depositgold is equal or less than current gold, because depositgold is REAL and that condition only supports integer.
But on the other hand depositgold must be real so i can use power-math in my action

What to do now?
 
OK, everything works, thx for help a lot. Now i know how to use conversion..
 
Status
Not open for further replies.
Back
Top