Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old fork of the sphere with features #1227

Open
Steinny opened this issue Apr 6, 2024 · 3 comments
Open

Old fork of the sphere with features #1227

Steinny opened this issue Apr 6, 2024 · 3 comments

Comments

@Steinny
Copy link

Steinny commented Apr 6, 2024

I have an old fork of the sphere, even before it became free.
and there are a couple of interesting features there.
I can even share the source code with you if it makes your task easier.

#item1

"plocal" like "ref1" but with "nametag"

plocal.blabla =
plocal.name = House
plocal.bounce

#item2

I don't use a LIST, but when working with tags
Instead of;

if
for i 0 <eval( - 1)>
if strmatch("template_*","<tagat.<local.i>.key>")

	endif
endfor

endif

we have this;

fortags template_*
say <local._var_name> <local._var_value>
endfor

#item3

trigger @SaveStart @saveend
on item and chars

#item4

serv.addtimerd 0 f_function
like timerf but work on serv. with timer 1/10 sec

[FUNCTION f_function]
ref1 =
ref1.try

#item4

[ADIALOG
dialogtype

DTYPE_NEW 01 // do not interfere with targets and dclick
DTYPE_SINGLE 02 // allows only one such dialog on the screen
DTYPE_SINGLE_OBJ 04 // allows only one such dialog on the object
DTYPE_NOUPDATE 08 // with 02 and 04 - forbid updating the dialog on repeated call

#item5

ADIALOGCLOSE type, arg1, arg2, buttonID

0x1 - arg1 = resource id of dialog (example "ad_dialog") - close the dialog with this ID
0x2 - arg2 = object uid - close the dialog on this object
0x4 - close all dialogs with these flags, otherwise the first one
if type = 0 - arg1 = dialog uid (return like ) - close the dialog with this UID
buttonID - The ID of the button that the dialog will close with (-1 - system close)

	On=@Equip
		src.tag.xz = <adialog ad_xz>
	
	On=@Unequip
		src.adialogclose 0,<src.tag.xz>,0,-1  - close the dialog with this UID
		
		
	On=@Equip
		adialog ad_xz
	
	On=@Unequip
		src.adialogclose 07,ad_xz,<uid>,-1 - close all dialog on this OBJ
@xwerswoodx
Copy link
Contributor

xwerswoodx commented Apr 6, 2024

I don't see any reason to be added as we already have them,

FOR loop or FORTAGS loops is not a big deal, can be added but I am not sure if it's necessary.

REF1 is a CUID reference so you can use .NAME .TYPE .BLABLA, so no need to add PLOCAL for it.

@SaveStart and @saveend triggers for every item can be really expensive, I am not sure but it can be added after made some tests.

We don't need ADDTIMERD as we already have TIMERFMS for it.

For dialog close, we already have dialogclose command for any dialog but it may be improved.

@cbnolok
Copy link
Contributor

cbnolok commented May 6, 2024

  1. Can you explain better PLOCAL? It looks like REFx.
  2. I fear this will encourage using a lot of tags, polluting them, but per se it could be a good idea.
  3. 100% sure it will be really too much expensive.
    4, 5) I second what xwerswoodx said.

@Steinny
Copy link
Author

Steinny commented May 7, 2024

  1. I'll finish you off
    we have also PTAG like tag+ref.
    ptag.item =
    ptag.item.name = blablba
    ptag.item.cont =

first of all, it is clear and readable

plocal.sys
plocal.plr
plocal.item
plocal.npc

on the third page, I already forget what happened at the beginning.

well, for example, there is also comfort

for 1 2
	local.i = "<eval(<local._for>)>"
	doswitch <local.i> - 1
		begin
			plocal.npc_<local.i> = <f_newnpc c_enc_angel>
			plocal.npc_<local.i>.speechcolor 050
		end
		begin
			plocal.npc_<local.i> = <f_newnpc c_enc_daemon>
			plocal.npc_<local.i>.speechcolor 112
		end
	enddo
	plocal.npc_<local.i>.p = <args>
	doswitch <local.i> - 1
		plocal.npc_<local.i>.move 1 <eval {-1 1}>
		plocal.npc_<local.i>.move <eval {-1 1}> -1
	enddo
endfor
  1. Well, these are actually my seconds, why should you count them?
    I use BACKGROUND SAVE and it's almost unnoticeable

or you can do it so that it can be enabled and disabled from scripts. in principle, is this enough for statistics once a day?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants