• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Letter System 4.0

This is a Fairly simple System that Is completly unique (As far as I know).

You type:
-letter (Message you want it to say)
and it gives you an item that, when clicked, says that message.

This System No Longer Uses Custom Values!

This System could be good for Loaps or Rp's or Rpg's Or other stuff I geuss.

I have Added a Package System that pretty much Disguises an Item as a box, so that you don't know whats inside till you open it. (Another easy one that hasn't been done before...as far as I know)

[trigger=Command]Command
Command1
Events
Player - Player 1 (Red) types a chat message containing -letter as A substring
Conditions
Actions
Set UnitTemp = No unit
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to True
Then - Actions
Set UnitTemp = (Picked unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
UnitTemp Equal to No unit
Then - Actions
Hero - Create Letter and give it to UnitTemp
Hashtable - Save (Substring((Entered chat string), 9, (Length of (Entered chat string)))) as 0 of (Key (Last created item)) in Hashtable[/trigger][trigger=ReadLetter]ReadLetter
ReadLetter
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Letter
Actions
Custom script: call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, LoadStr(udg_Hashtable, GetHandleId(GetManipulatedItem()), 0))
[/trigger]

Update 1: Found a spot I messed up on. Fixed. Started on the currently not working Box system.

Update 2: Replaced Custom Values with a hastable

Update 3: Got Box System to work with Hashtables. <-(New Best Friend!)

Updates 4&5:
-Added Trigger Code.

Update 6:
Added to the best of my abilities what Bribe said (Didn't understand the command part) so I just got rid of the leak.

Update 7:
Fixed leak for good hopefully.

Update 8:
Simple bug Fix. (A Not equal was set to Equal!)
This is Problem Maker Pointed out.


IMPORTANT!!!!
Made it So that you can no longer team and private chat!
If you don't want an enemy to see something then send a Letter!

(NOTE: This Function may NOT be Imported to other maps!!!)
(Note: If you don't want players to see any chat what so ever, PM Me)
I Used This Tutorial for the invisible Chat:
Tutorial

To get these Triggers into your map you should:
1) Go to File -> Prefrences -> General -> Check ON "Automatically Creat Unknown Variables While Pasting trigger Data" If you havent already.
2) Copy the 'Letter Coding' Folder into your map.
3) Enjoy : D

First Thing you should do After you get this into your map is:
1) Nothing, It should work Right away

To Bribe:
-I Apologize that this map has had so many problems bribe.
-The reason I did the condition that way was so somebody could customize it easier but I did what you said

-I Fixed what you said but the box part isn't really part of the code its more of a sidelines thing.
-Sorry took so long to respond I didn't know what you were talking about so I figured I shouldn't worry about it.

Keywords:
Letter, system, package, mail, item, message, box, gift, hidden, chat, invisble
Contents

Letter System (Map)

Reviews
Maker, 18.07.2011: Approved. I guess the idea is somewhat original and people have liked it so it could be useful. It's very simple though, you could add crypted messages so not every player can read it for example.

Moderator

M

Moderator

Maker, 18.07.2011:
Approved. I guess the idea is somewhat original and people have liked it so it could be useful. It's very simple though, you could add crypted messages so not every player can read it for example.
 
Level 18
Joined
Mar 7, 2005
Messages
824
It's very useful for many RPGs out there.. and I don't think it's used to chat with other people :p because there are more effective ways to do so..

you can easily expand your quests by simple transport jobs. Like I wrote a Love Letter for my Sweethear, could you bring it to her? And you'll get the letter, can read it after clicking on it, and you have an item that you have to carry to his Sweetheart.. so it's useful for Quests, and also other stuff ;)
 
Level 7
Joined
Apr 1, 2010
Messages
289
i like this

I have been thinking about something lie this, its a great idea, it would be useful in a game where chat is only sent to people who have there guy a certain distance from you, and then you could have a mail box in it.... well plus +rep great job.
 
Level 8
Joined
Nov 21, 2008
Messages
316
I have been thinking about something lie this, its a great idea, it would be useful in a game where chat is only sent to people who have there guy a certain distance from you, and then you could have a mail box in it.... well plus +rep great job.

lol that would be epic. l imagine a war game, where whatever you say only reaches your allies if they're close. people would have to use the letter's to deliver messages to distant comrades. lol Just think if the messenger dies, the message is intercepted by enemy forces. +rep to my epic imagination
 
Level 18
Joined
Mar 7, 2005
Messages
824
yeah some cool mail box system..

like:

-send player1 xxxxx

and after that player1 receives an item with the message the other player wrote to it :D
(could be useful for maps with custom chat systems, like the ones that show the message/text above their heads.. with those item-letters you could sent some PMs or out-of-view texts to this player.. and only for this player) :)
 
yeah some cool mail box system..

like:

-send player1 xxxxx

and after that player1 receives an item with the message the other player wrote to it :D
(could be useful for maps with custom chat systems, like the ones that show the message/text above their heads.. with those item-letters you could sent some PMs or out-of-view texts to this player.. and only for this player) :)


I have actually thought about, and started something like this.
 
All right apparently I don't know the meaning of MPI (Not being Sarcastic). So could somone explain it to me?

I know that Mui is Multi-Unit-Instanceable meaning multiple units can use it at once but what is Mpi?
And what did the moderator mean by im not incrementing it?
I thought it meant increase in value but that doesnt make sense in the comment he made, cuz I did increase it in value.
Nvm mind I must have missed that wich is weird because, I tested it multiple times. Updating...

ok Fixed.
Wait, Does Mpi mean that its Mult-Player-Instancable? If so then the moderator is wrong because...it is...I Think. Help?

Ok 3rd edits the charm? I found a tutorial on Hastables and to be honest Im lost, I now understand it a little bit but...Its still pretty confusing.
 
Last edited:
Level 11
Joined
Sep 12, 2008
Messages
657
every 1 says custom values interrupt with another codes..
so just make a comment to not upload it if he uses another custom values system or it could cause some errors..
and check if the unit allready has a custom value when adding him..
then nothing bad could happend..

Or im wrong.. ;p im pretty sure thats gonna work o.o
 
Level 4
Joined
Jan 9, 2010
Messages
98
I got a friend who is working on a Role Playing game. I will send him the map and he might find use to it. Thanks for it !
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Someone has pointed out to me my absurd lack of observation. The triggers here need to be totally remade:

[trigger=Command]Command
Events
Player - Player 1 (Red) types a chat message containing -letter as A substring
Conditions
Actions
Selection - Sync selections
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units currently selected by (Triggering player) Matching ((Matching unit) is A Hero)) and do (Actions)
Loop - Actions
Hero - Create Letter and give it to (Picked unit)
Hashtable - Save (Substring((Entered chat string), 9, (Length of (Entered chat string)))) as 0 of (Key (Last created item)) in LS_Hashtable
[/trigger]
[trigger=ReadLetter]ReadLetter
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Letter
Actions
Custom script: call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, LoadStr(udg_LS_Hashtable, GetHandleId(GetManipulatedItem()), 0))
[/trigger]
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
The short trigger is fine, but the other trigger still has leaks. Here's a fixed version:

  • Command1
    • Events
      • Player 1 (Red) types a chat message containing -letter as A substring
      • Player 2 (Blue) types a chat message containing -letter as A substring
      • Player 3 (Teal) types a chat message containing -letter as A substring
      • Player 4 (Purple) types a chat message containing -letter as A substring
      • Player 5 (Yellow) types a chat message containing -letter as A substring
      • Player 6 (Orange) types a chat message containing -letter as A substring
      • Player 7 (Green) types a chat message containing -letter as A substring
      • Player 8 (Pink) types a chat message containing -letter as A substring
      • Player 9 (Gray) types a chat message containing -letter as A substring
      • Player 10 (Light Blue) types a chat message containing -letter as A substring
      • Player 11 (Dark Green) types a chat message containing -letter as A substring
      • Player 12 (Brown) types a chat message containing -letter as A substring
    • Conditions
    • Actions
      • Set Unit = No unit
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units currently selected by (Triggering player) Matching ((Matching unit) is a Hero) Equal to True) and do (Actions)
        • Loop - Actions
          • Set Unit = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit not equal to No unit)
        • Then - Actions
          • Hero - Create Letter and give it to Unit
          • Hashtable - Save (Substring((Entered chat string) 9 (Length of (Entered chat string)))) as 0 of (Key (Last created item)) in Hashtable
        • Else - Actions
 
Last edited:
There is instructions for installing in the Help/Readme. However I will put some text here aswell.

*Merged Post*
@Gopinich
-You can have more than one letter.
-I Disabled Team and Private chat so if you want to say something privately you have to send a letter.
-Read the whole description before complaining.
 
Last edited:
Level 4
Joined
Nov 24, 2010
Messages
61
@Gopinich
-You can have more than one letter.
-I Disabled Team and Private chat so if you want to say something privately you have to send a letter.
-Read the whole description before complaining.

  • Hashtable - Save (Substring((Entered chat string), 9, (Length of (Entered chat string)))) as 0 of (Key (Last created item)) in Hashtable
Oh I see :S. I need to learn more about Hashtable.

I have an idea for you: If the target hero have full inventory, what happen? You should make a Mail Box for each player, send the letter to it and notice the player.
-Read the whole description before complaining.
And I'm not "complain". Don't be serious!
 
Top