Frequently Asked Questions

Frequently Asked Questions

> Encyclopedia

How do I fire a pistol three times?

Each leek has a certain number of Turn Points (TP) (10 at level 1, but this can change), which determines the number of actions you can take during the turn.

Thus, firing a pistol costs 3 TP, so you can do it 3 times in one turn by spending 9 TP.

To do this, shoot several times, all you need is enough TP, and to write the instruction that allows you to shoot several times, by doing for example:

You can also use a loop (see: Loops).

Why are the leeks I face a higher level than mine?

The opponents are selected based on the talent of your leek. In each fight, a leek gains or loses talent depending on the outcome of the fight. The outcome of a fight depends on each player's AI, their characteristics, as well as their weapons and chips. Talent therefore reflects how this set performs against other players.

Confronting leeks of a higher level is therefore rather a good sign. This means that your strategy (your gear and stat choices, as well as your AI) can make up for the difference in level, and therefore stats.

With victories, your leek gains talent, and therefore faces stronger and stronger opponents. When you start losing, his talent will increase more slowly, or even decrease. You are therefore guaranteed to face opponents that are as balanced as possible depending on the players available.

On top of that, there are a lot of abandoned leeks at low level. They were able to gain levels by being attacked without their AI being improved or their characteristics being increased. This helps provide you with opponents that may seem stronger.

Don't worry, it will calm down with the levels. And if it continues at a high level, then take it as a compliment!

Why does my leek explode?

This happens when an error causes your AI to stop. In this case, you have to look at the error message displayed in the combat report. Generally, this happens when a game limit has been reached, such as the limit of Operations, for example.

Why do I get an error message that says "too many operations performed in this turn"?

In an AI, each function call, each variable use, costs Operations.

A leek can perform up to 20 million operations per turn.

This message is displayed when this limit is exceeded. At low level, this usually happens when an infinite loop is present in the AI.

Why doesn't my leek do the same thing in the test and in the garden?

When doing a test fight, you can choose the AI you want to test from a list located just above the test leek selection, and this AI can be different from the one used by the leek in the Garden, which must be modified on the leek page.

How do I summon a bulb?

The first bulb, the Puny Bulb (CHIP\_PUNY\_BULB), is available at level 48. Bulb AIs must be coded into functions. For example, to make my bulb move to its summoner and then boost with Protein:

function punyAI() { moveToward(getSummoner()) useChip(CHIP_PROTEIN, getEntity()) }

To invoke the bulb, you must not use the function useChip but summon as follows (for our example):

// cell: the cell where you want to invoke the bulb summon(CHIP_PUNY_BULB, cell, punyAI)

Be careful not to put "()" after the name of the bulb's AI: it's the function itself that we put as a parameter, not its hypothetical return. More details on the Bulbs page.

How are the characteristics of a bulb assigned?

The characteristics of a bulb are calculated according to the level of the leek that summons it. The maximum is reached when the summoner is level 300 (or higher), and the minimum when the summoner is level 1 (which is not possible in practice).

Between the two levels, the characteristics are calculated linearly, using the following formula:

characteristic = floor(min + (max - min) * min(300, summonerlevel) / 300)

If the level of the summoner is 301, the characteristics are those of a level 300 summoner.

How are the characteristics of a leek assigned?

It's up to you to spend your Capital Points obtained with the levels in your leek's characteristics tree. (this is a crucial point, in the progression of your leeks)

More details on the Characteristics page to distribute your Capital Points

How to store more weapons and chips?

Your leek gains a chip slot at levels 50/75/100/125/150/200/250/300 and a weapon slot at levels 100/200.

More details on the Chips and Weapons page.

How to grow more leeks?

As stated in the "Farmer" section of /help/general.

Thereafter you can obtain up to 4 leeks, under the following conditions:

How do I find my own mistakes?

Before calling for help on the Chat when your AI is not performing as expected, you can add debug() to your code which will allow you to understand what is happening:

This code will display in the combat report the contents of the Enemy variable preceded by the string "Number of my nearest enemy=". The debug() does not cost turn points (TP) but it is better not to abuse it too much because it makes reading the reports more difficult and because the number of debug() allowed per fight is not infinite.

A debug() can display an array, for example

will show a table in the report with the numbers of allied living entities. That said, when manipulating arrays of boxes it is much more convenient to color the boxes directly on the map during combat using the mark() function:

This code will color the cell to the right of your leek on the map in red. Note: you can create your own colors with the getColor() function, you can even draw rainbows or the Mona Lisa!

How to keep variables from one turn to the next?

Just use global variables, with the keyword global:

Or static fields of classes, with the keyword static: