Jump to content
Sign in to follow this  
1g0rS1lv4

Portal Maps

Recommended Posts

wooh this cool if this is really work and update by it self this is cool. if it work I think it come just normally in portal script.. idk tho if it need some update script like "if player +1 then update or if player -1 then update".

 

I'm not sure, first time see this and if its really idk..

Edited by Onioni
  • Like 1

Download: Nightmare Demonic Helm

Dimension Pirates Online files: get now

New map Project: Flag PK

Black Skin 3.1.3 for pko 1: Get now

Share this post


Link to post
Share on other sites

I released one on discord (none production code, just proof of workability). It is the same concept of GetPlayerByName where the data is stored in tables for later retrieval.

 

but there are a few problems that I've discussed with Sultan,

1) I think something to do with memory addy? A long time ago I used luajit ffi to call some C api to check this. I do not remember results

2) there was something with inconsistent writings to the name field of structure. Sometimes it writes/ sometimes it don't. 

  • Like 1

kong.png

a2.png

Share this post


Link to post
Share on other sites
32 minutes ago, KONG said:

I released one on discord (none production code, just proof of workability). It is the same concept of GetPlayerByName where the data is stored in tables for later retrieval.

 

but there are a few problems that I've discussed with Sultan,

1) I think something to do with memory addy? A long time ago I used luajit ffi to call some C api to check this. I do not remember results

2) there was something with inconsistent writings to the name field of structure. Sometimes it writes/ sometimes it don't. 

I suggest using KONG's one,it actually works perfectly.

  • Like 1

Share this post


Link to post
Share on other sites
entrydata = entrydata or {}

SetMapEntryEventNameHook = SetMapEntryEventName
function SetMapEntryEventName(entry, name)
	SetMapEntryEventNameHook(entry, name)
	map_name, posx, posy, tmap_name = GetMapEntryPosInfo(entry)
	entrydata[tmap_name] = entry
end

function GetEntryDataByName(map)
	return entrydata[map]
end

function SetPortalName(map, name)
	local entry = GetEntryDataByName(map)
	if entry ~= nil then
		SetMapEntryEventName(entry, name)
	end
end
--put this into ctrl.lua of a map
function map_copy_run_x( map_copy )
SetPortalName("garnerexample", "Garner - Alive Players: "..GetMapActivePlayer(map_copy).."")

end

PS:Make sure to run your map with the same map that has the portal to have the function working.

Edited by x3wor
edited 2
  • Like 1

Share this post


Link to post
Share on other sites

@x3worFor what use of cha_timer inside your codes? return values will be nil also on GetEntryDataByName() since entrydata not defined.

Edited by Satan

lelouch_signature_by_vahntheknight-d4uafwj.png

Share this post


Link to post
Share on other sites
39 minutes ago, Satan said:

@x3worFor what use of cha_timer inside your codes? return values will be nil also on GetEntryDataByName() since entrydata not defined.

Oh wait, didn't pay attention, sec..

Share this post


Link to post
Share on other sites
On 26/01/2018 at 3:48 PM, x3wor said:

entrydata = entrydata or {}

SetMapEntryEventNameHook = SetMapEntryEventName
function SetMapEntryEventName(entry, name)
	SetMapEntryEventNameHook(entry, name)
	map_name, posx, posy, tmap_name = GetMapEntryPosInfo(entry)
	entrydata[tmap_name] = entry
end

function GetEntryDataByName(map)
	return entrydata[map]
end

function SetPortalName(map, name)
	local entry = GetEntryDataByName(map)
	if entry ~= nil then
		SetMapEntryEventName(entry, name)
	end
end
--put this into ctrl.lua of a map
function map_copy_run_x( map_copy )
SetPortalName("garnerexample", "Garner - Alive Players: "..GetMapActivePlayer(map_copy).."")

end

PS:Make sure to run your map with the same map that has the portal to have the function working.

where i put this code?

Share this post


Link to post
Share on other sites

First one goes to functions.lua (the very bottom)

The second one to your map ctrl.lua

 

If in map_copy_run doesn't work, put it in after_enter_map function in either entry or ctrl.lua

Share this post


Link to post
Share on other sites
On 10/22/2022 at 10:31 PM, Brothers said:

For Forsaken city, i change all map to Abandone... right?

What are you trying to do?


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...