Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Our single upgrade that we have in the game does not yet have any effect
So let's go ahead and make it work
So I'm going to make it work well recall that we have the sword ability controller which you can go out in open
An assault ability controller
Sponsor sword on a specific into
We want to be able to control or reduce that interview
Beeston
An upgrade being chosen
So what are we going to do about that well what we can do
We can
Create a
Game
In our game events Singleton
That will
Notify any listeners when
The
Current up
It's have been up to
And then along with that event
We can pass
The Resource that was added as well
What's the current
Dad's going to
As well as the credit upgrades
That's going to be a lot clearer as we get into it
So let's go in open up our game events autoload
Subtitled by online-courses.club We compress knowledge for you!
And then let's go here and open up the screen
And so we got it right here
Let's create a new Sid
Signal
Ability
Upgrade
Update
Let's do this let's you ability upgrade
Added
So we're going to call it a building upgrade
We're going to call the first parameter upgrade
Which is of type of building upgrade
And then were going to add a second parameter which is current upgrades and running cold
Dictionary
So that will be representative of our current upgrades for more upgrade
Manager
Let's create a new funk
Bank in May
Ability upgrades
Added and we're going to copy and
Please to these parameters because they'll be exactly the same
And at the end
And were simply just going to do ability
Upgrade added.in
Upgrade
And then
That looks redundant it is but that's because we're essentially doing a real
For sending data up and then through the game so up to the game events or load and then down to Earth
So let's go ahead and
Open up our upgrade manager
And in our apply upgrade function
For keeping track of the current upgrades
And also have a rash
Cancel the upgrade so what we're going to do in here
Is outside of any of these blocks
We're going to say game
Start in May
Ability upgrades added
Just Dad functions that we just added to
And we're going to pass in the upgrade as well
The current
So now we're going to hell that we can go to what sort of bills
Controller
And open up that script
And then in already method what we can do as we can say a game event
Dart
Ability upgrades
Dr No
To write on ability upgrade
And then
Let's create a new function to buy
Song
On mobility
Upgrade
And then we have the upgrade coming in which is up type ability up
And we also have the current
Grades
Coming in
Dictionary
And this is where we're going to want to
Recalculate
The
Time is wait time so there's a couple of setup we need to do hear something
Pass rate here just to make this
Not error out right now
When I go to my
Seen over here it's like the timer
So over here we have a wait time of 1.5
In if I upgrade is going to reduce the wait time by 10% every time
We need to store what a base weight
So let's create a new variable
And I'm going to put a line between the stair with variable and export
Create a new variable
Call
Default
Wait
Time or electronic bass wait time
Then I'm ready let's go ahead in a sign that bass wait time and when I do it up here first
Raceway time is it good to
Timer
So restoring that bass wait time
Ok so now down your own ability upgrade ad and how are we going to do
As well firstly were going to say if upgrade ID
Is not equal to
Sword
Wait remember this is our ID so we can double check this by going to a file system
Resource
Does upgrade
And then
Sword rate.to
This is r i d here
I'm just going to make sure that this is correct by copying and pasting it over here
Sofa upgrade ideas nautical to sword great we're just going over
Ok
This is going to be very important
Because
Essentially saying we're going to ignore any ability upgrades that happen that are not
Related
That means if we add more up
The game
This function is still going to be called because it's just listening for all ability upgrades
What temperature is going to filter out the ones that we don't care about in here
Ok so that means that if we make it past that block then we are dealing with
A type
Of sword rate
So what are we going to do we're going to calculate a new weight
And what we're going to say is
Bar percent
Reduction
Is equal to
We're going to take the current upgrades
And remember we can index it bye
The sword underscore rate so that I die
And then we're going to grab
The quantity
Ok so that's
How much how many of these upgrades we have
And we're going to multiply this by
10% of .1
So what this is going to do is this is going to tell us
Check the number of Sword of the
X 0.1
Sophie of two little by twenty percent
Three 30%
Then all we need to do is we need to take the timer
And I need to set it wait time
Equal to
The bass wait time
X
And then we have to do
1
Miners
The process
And so if I percent reduction is
.1
That will evaluate to 90% and were basically saying
We're doing 90% of the base weight
Time is going to be the new wait time
Ok
So that's our timer now
Since our timer is continually running it never stop
And that is because we have one sure
Off
So one shot me
Should the timer just run once and then stop
If it's on
So that means there's a timer
Running over and over and over
Because of that
We cannot just change the wait time and expected to work
We actually need to call timer that start
Again
So if I search for start in my
F1
Dr documentation menu
I can scroll down until I find
Set a timer
I can opener
And it says right here
It also reset the remaining time to wait time
So start the centrally restart the timer
Using the new wait time
We can figure
Alright and just to be certain that this is working let's go ahead and print
Time adult wait time
And also we can
Drastically increase this percent reduction
So just temporarily what I'm going to do is instead of this being 0.1 I'm going to make it point
Ok let's Run the game and see if that upgrade actually works
Ok
So I've got my sword I'm going to shrink this window
When I click that
You can see that my sword is now attacking much fat
And if I collect some upgrades again
It should be sworn in even faster
Ok so that's working great
I'm going to remove this print statement from the sort of building control
And I'm going to send this back to .1
And that is our first ability upgrade
Implement
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.