FOnline Development > Questions and Answers

FOnline SDK - Question

<< < (76/93) > >>

Ras:
I have a question.
Does anyone know how to set random spawn player in encounter map when someone enter inside.
Although they are added many enter points, player still appears only on the same one

wladimiiir:
In function worldmap@GenerateEncounter there should be this part of code:

--- Code: ---uint16 startX = 0, startY = 0;
if( not map.GetEntireCoords( 0, 0, startX, startY ) )
{
    Log( "Default entire not found." );
    return null;
}
fe.StartHexX = startX;
fe.StartHexY = startY;
--- End code ---

StartHexY and StartHexY should be the coordinates of place where you will spawn. You can change it like in the following example to have random spawn location:

--- Code: ---uint16 startX = 0, startY = 0;

Entire[] entires;
ParseEntires(map, entires, 0); //0 - entire num

if(entires.length() == 0)
{
    Log( "Default entire not found." );
    return null;
}
uint index = Random(0, entires.length() - 1);
fe.StartHexX = entires[index].HexX;
fe.StartHexY = entires[index].HexY;
--- End code ---

In the example above, you will also have to include entire.fos to the script.

--- Code: ---#include "entire.fos"
--- End code ---

Ras:

--- Quote from: Mike Wall on April 23, 2013, 09:27:12 am ---In function worldmap@GenerateEncounter there should be this part of code:

--- Code: ---uint16 startX = 0, startY = 0;
if( not map.GetEntireCoords( 0, 0, startX, startY ) )

--- End code ---
...

--- End quote ---

Works fine, thx man !

MrCovin:

--- Quote from: Mike Wall on April 21, 2013, 09:17:20 pm ---Make sure that your NPC has MODE_NO_BARTER set to 0 (otherwise the message "You cannot trade with this person." will be shown).


--- Code: ---npc.ModeBase[MODE_NO_BARTER] = 0;
--- End code ---

--- End quote ---

Thanks a lot :)

MrCovin:
I saw that a 'NCR Invasion' exist, how does it works ? What npc can provides me this quest ?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version