Explore

» Siedler Map Source Forum » Siedler DEdK Script Forum » Explore

Seiten: 1

Qba331PL
#1
07.08.2018 10:45
Beiträge: 102

Explore

Hi!

How to add single explore function in script and how to remove it? For example: You talk with NPC. It shows you your destination (you can see it with explore) that is marked with marker on the minimap. Then you come there, you do mission and marker and expolre dissapear (we don't need them anymore).

mundn
#2
07.08.2018 12:27
Beiträge: 83

You can use this:

test()

function test()
 local npc = {
 name = "AAA",
 callback = BriefingA,
 }
 CreateNPC(npc)
end

function BriefingA()
 local briefing = {};
 local AP, ASP = AddPages(briefing);
	
 --safe the briefingPage
 page1 = AP {				--!you need the comfort below for AP{...}!
   title    = "title",
   text     = "text",
   position = GetPosition("explore"), --position to explore
   explore  = 500, --Explore in a range
   marker   = ANIMATED_MARKER --Sets the animated marker on the minimap
 }
	
 briefing.finished = function()
  StartSimpleJob("SimpleJobExp")
 end
						
 StartBriefing(briefing);	
end

function SimpleJobExp()
 if IsNear("hero","explore",200) then
  ResolveBriefing(page1) --Deletes the Marker and exploration
 end
end

--COMFORT

function AddPages( _briefing )
    local AP = function(_page) table.insert(_briefing, _page); return _page; end
    local ASP = function(_entity, _title, _text, _dialog) return AP(CreateShortPage(_entity, _title, _text, _dialog)); end
    return AP, ASP;
end

function CreateShortPage( _entity, _title, _text, _dialog) 
    local page = {
        title = _title,
        text = _text,
        position = GetPosition( _entity ),
        dialogCamera = _dialog
    };
    return page;
end



____________________
Scripten bei Master pewe in DEdK Script-Wiki gelernt ich habe.

mcb
#3
07.08.2018 12:27
Beiträge: 1472

You can add some keys to your briefing:

local page3 = AP{
        title        = "Missionsziel",
        text         = "Gehe zu der Burg und vernichte sie!",
        position     = GetPosition("Player2"),
        explore      = BRIEFING_EXPLORATION_RANGE,  -- this is how much area around position gets expored, you can add any number
        marker       = ANIMATED_MARKER              -- adds a minimap marker (green, if you want other colors, you have to do it yourself)
     }


After you finished the quest, just call

ResolveBriefing(page3)

to remove both marker and explore. You can combine this with the quest from the same page, so when you resolve the page you finish the quest and remove marker and explore.

Qba331PL
#4
07.08.2018 12:56
Beiträge: 102

Yeah, but there is another explore function. I don't know where I've seen it last time and I can't find it. It was something like: ExploreArea(parameters). I don't want to use briefings.

Der_Deutsche
#5
07.08.2018 13:07
Beiträge: 349
mundn
#6
07.08.2018 13:18
Beiträge: 83

function ExpoloreWithMarker()
	local _pos = GetPosition("explore")
	GUI.CreateMinimapPulse(_pos.X, _pos.Y, 2)
	Explore.Show("abc", _pos, 500)
end

function DestroyExpoloreWithMarker()
	local _pos = GetPosition("explore")
	GUI.DestroyMinimapPulse(_pos.X, _pos.Y)
	Explore.Hide("abc")
end



you can use this to avoid a briefing.

Explore.Show(_ID, _pos, _range) --_ID must be unique


will explore the map


Explore.Hide(_ID)


will delete the exploration


GUI.CreateMinimapPulse(_pos.X, _pos.Y, _number)


will create a pulse (_number is the color 0=green, 1=blue 2=white ...)


GUI.DestroyMinimapPulse(_pos.X, _pos.Y)


will delete the pulse at the given position

____________________
Scripten bei Master pewe in DEdK Script-Wiki gelernt ich habe.

mcb
#7
07.08.2018 13:33
Beiträge: 1472

You can also use Tools.ExploreArea(_x, _y, _Range) (your range from the briefing and Explore must be divided by 100 to get the same result) which returns an entity, that you can destroy to remove the explored area.

GUI.CreateMinimapPulse(_x, _y, _color) colors are: 0->green, 1->blue, 2->white, 3->red
You can alternatively use GUI.CreateMinimapMarker(_x, _y, _color) whic creates a similar marker that doesn't move (colors are the same, destroy also with GUI.DestroyMinimapPulse(_x, _y))

You could also use GUI.ScriptSignal(_posX, _posY, _color) which creates a marker that stays only for a fixed amount of time (used to make the "You get attacked" markers).

Edit: To show all of the map yust add a large enough range to whatever explore you like.

Qba331PL
#8
07.08.2018 14:39
Beiträge: 102

Thank you guys !!!

Seiten: 1

SiteEngine v1.5.0 by nevermind, ©2005-2007
Design by SpiderFive (www.siedler-games.de) - English translation by juja

Impressum