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
Saving information in one tag
Author Message
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #1
Saving information in one tag
I would like to remove/forbid the recall spell and use teleports like in Elder Scroll IV: Oblivion.

But I'm not sure, how to save it. My idea is to set "tag.teleport" on a player and every entrance to a dungeon would be represented with something (that's what I need help with). I thought, by letters from A to Z - the whole alphabet. As the player enters the region of the entrance to a dungeon the trigger on=@enter fires and checks whether the player's tag.teleport contains the letter.

The main portal will be in a town. As the player goes thought the world, he/she finds the entrances etc. and in the moment he/she finds it, he/she can teleport from the town to the dungeon.

The problem is, the alphabet has only 26 chars, it means only 26 possible teleports.

Don't you know a similar trick with numbers, or something like that?
For example 1.dungeon represents number 1, 2.dung number 2.
If the tag is 0 => the player hasn't found neither the first dung nor the second.
If the tag is 1 => the player has found the first one.
If the tag is 2 => found only the second one.
If its 3 => found both.

Hope you understand what I mean.
(This post was last modified: 07-11-2013 05:09 AM by Alaric.)
07-11-2013 05:04 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: #2
RE: Saving information in one tag
Yea you can store one or more bitmask in a tag, bitmask can hold up to 32 different values so with just three you can store up to 96 different location.

Example with 3 bitmask stored in a tag :


First, it's better you organize your dungeon locations bitmask values inside a defname.

3 bitmask -> 3 defnames

PHP Code:
[DEFNAME dungeon_group_1]
g1_dung_1   01
g1_dung_2   02
g1_dung_3   04
g1_dung_4   08
g1_dung_5   010
g1_dung_6   020
..
g1_dung_32 080000000  //0+ eight bit 

same thing for 2nd bitmaks and bitmask

PHP Code:
[DEFNAME dungeon_group_2]
g2_dung_1   01
g2_dung_2   02
g2_dung_3   04
g2_dung_4   08
g2_dung_5   010
g2_dung_6   020
..
g2_dung_32 080000000 

[DEFNAME dungeon_group_3]
g3_dung_1   01
g3_dung_2   02
g3_dung_3   04
g3_dung_4   08
g3_dung_5   010
g3_dung_6   020
..
g3_dung_32 080000000 

When a your player will enter in a dungeon area you will have to do the check/set of the bitmask.

PHP Code:
//In dungeon g1_dung_2
ON=@Enter
src
.check_dungeon_bitmask 1,<def.g1_dung_2>,<src.tag0.teleport>

//argv[2] is the first bitmask, argv[3] second bitmask, argv[4] third bitmask.
//argv[0] is the bitmask group.
//argv[1] is the value you want to compare.

[FUNCTION check_dungeon_bitmask]
// i don't remember if you can edit argv, so i'll use local
local.mask_1 = <argv[2]>
local.mask_2 = <argv[3]>
local.mask_3 = <argv[4]>

//<local.mask_<dargv[0]> will take the appropriate bitmask group 
if <local.mask_<dargv[0]>&<argv[1]>  // i already know this place
    
return
else  
// i don't know this place
    //adding the dungeon bit value to local.mask_<dargv[0]>
    
local.mask_<dargv[0]> |= <argv[1]>  
    
//setting it to the player,in our case local.mask_1 is changed
    
tag.teleport = <local.mask_1>,<local.mask_2>,<local.mask_3>
    return 
endif 

Well it looks weird and i didn't test it, but it should works theorically !
Also the check function will need some restyling.

Best way will be to use just @RegionEnter trigger and storing the dungeon bitmask value in
a tag contained in the areadef of the dungeon entrace.

Or you can use LIST for handling all of this crap Tongue
(This post was last modified: 07-11-2013 06:13 AM by darksun84.)
07-11-2013 05:28 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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