The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defname calling
Author Message
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #1
Defname calling
Hi,

How can i call some piece of defname ? It's possible ? Because there is my script and it returns "0" instead of "hello".

[DIALOG d_settings TEXT]
<f_make_text>

[function f_make_text]
local.test=<n_word>
return "<local.test>"

[DEFNAME settings]
n_word "hello "

I need it to my settings of shard (easy way to change and keep variables).

Thank you.
08-16-2016 01:00 PM
Find all posts by this user Like Post Quote this message in a reply
Criminal
Journeyman
*

Posts: 182
Likes Given: 38
Likes Received: 22 in 22 posts
Joined: Jun 2015
Reputation: 0

SantiagoUO.com

Post: #2
RE: Defname calling
<DEF.n_word>

[Image: mfqAZnj.png]
Discord: SantiagoUO
Skype:
criminaluo
08-16-2016 04:09 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #3
RE: Defname calling
Thanks ... I lost a couple of hours why it doesnt work Tongue
08-16-2016 09:21 PM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #4
RE: Defname calling
One more question ... how can i get 'decimal number' from defname ? Because it automatically converting to hexadecimal.

If i type 256, i got 100 hexa ... but i guess it can be problem later in another script, where i use this number.

I have this :
n_global_default[00] "100"

and it returns 064.
(This post was last modified: 08-16-2016 10:59 PM by Indiaret.)
08-16-2016 10:56 PM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #5
RE: Defname calling
<eval <def.n_word>>
08-16-2016 11:40 PM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #6
RE: Defname calling
Yea it works, thank you .
08-17-2016 02:15 AM
Find all posts by this user Like Post Quote this message in a reply
n1ghtwish
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 28 in 8 posts
Joined: Jan 2016
Reputation: 0



Post: #7
RE: Defname calling
or --

<dDEF.n_word>

save a little space in your file Wink
08-17-2016 06:42 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes n1ghtwish's post
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #8
RE: Defname calling
Well i have next problem ....

I need a short script, which determinates that i have weapon(in 1 or second hand) and gives me tag with UID of the weapon.

I have this, but this doesnt work. I dont know how to use if with layer - all variants with errors Sad.

Has somebody idea how to do it ?

[function weapon_char]
tag.weaponuid=0
if (<findlayer.1>)
if(findlayer.1.isweapon)
tag.weaponuid=<findlayer.1>
endif
endif
if (<findlayer.2>)
if(findlayer.2.isweapon)
tag.weaponuid=<findlayer.2>
endif
endif

[function isweapon]
if (type==t_weapon_sword)
elseif (type==t_weapon_fence)
elseif (type==t_weapon_mace_smith)
elseif (type==t_weapon_mace_crook)
elseif (type==t_weapon_mace_staff)
elseif (type==t_weapon_bow_run)
elseif (type==t_weapon_bow)
elseif (type==t_weapon_xbow)
else
return 0
endif
return <uid>
08-19-2016 03:19 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #9
RE: Defname calling
First, you should rename your function because the isweapon function already exists, it's a built-in function that determines if an item is a weapon or not. ( http://wiki.sphere.torfo.org/index.php/Items )

Second, you can just use the <weapon> reference for returning the weapon's uid. ( http://wiki.sphere.torfo.org/index.php/Characters )


[FUNCTION weapon_char]
if <weapon>
tag.weaponuid = <weapon>
endif
08-19-2016 04:44 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #10
RE: Defname calling
Nice ! Smile thanks
08-19-2016 09:44 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)