• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] JASS section will open soon

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2004
Messages
70
What kind of stuff do you want in there?
I'm not really supporting The Jass Vault anymore, so if you like, we could move the whole bunch from there over here (or at least some of it).
I can arrange a mass export script if you want.


Btw, you use Jass in the trigger editor by going Edit>"Convert to custom text" in the menu while having a trigger selected.
 
Level 14
Joined
Sep 29, 2003
Messages
1,255
Hey Umm my friend made a trigger for me and he said that instead of putting it in w3 and going threw all of that mess take a code so the code was

JASS:
function Trig_Give_Gold_Conditions takes nothing returns boolean
   if ( not ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) >= S2I(SubStringBJ(GetEventPlayerChatString(), 9, 1000000000)) ) ) then
       return false
   endif
   return true
endfunction

function Trig_Give_Gold_Actions takes nothing returns nothing
   call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) - S2I(SubStringBJ(GetEventPlayerChatString(), 9, 1000000000)) ) )
   call SetPlayerStateBJ( ConvertedPlayer(S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7))), PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(ConvertedPlayer(S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7))), PLAYER_STATE_RESOURCE_GOLD) + S2I(SubStringBJ(GetEventPlayerChatString(), 9, 1000000000)) ) )
   call DisplayTextToForce( GetForceOfPlayer(ConvertedPlayer(S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7)))), ( udg_PlayerName[GetConvertedPlayerId(GetTriggerPlayer())] + ( "has given you |cffffcc00" + ( SubStringBJ(GetEventPlayerChatString(), 9, 1000000000) + "|r gold." ) ) ) )
endfunction

//===========================================================================
function InitTrig_Give_Gold takes nothing returns nothing
   set gg_trg_Give_Gold = CreateTrigger(  )
   call TriggerAddCondition( gg_trg_Give_Gold, Condition( function Trig_Give_Gold_Conditions ) )
   call TriggerAddAction( gg_trg_Give_Gold, function Trig_Give_Gold_Actions )
endfunction

so i saved it as in jass and it turned into
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil Courier New;}}
{\colortbl ;\red0\green0\blue0;\red0\green136\blue204;\red0\green0\blue128;\red128\green0\blue0;\red0\green0\blue255;\red120\green120\blue120;}
\viewkind4\uc1\pard\cf1\b\f0\fs18 function\b0 Trig_Give_Gold_Conditions \b takes\b0 \cf2 nothing\cf1 \b returns\b0 \cf2 boolean\cf1
\par \b if\b0 \b (\b0 \cf3 not\cf1 \b (\b0 \cf3 GetPlayerState\cf1\b (\cf3\b0 GetTriggerPlayer\cf1\b ()\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1\b )\b0 \cf3 >=\cf1 \cf3 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b ))\b0 \b )\b0 \b )\b0 \b then\b0
\par \cf3 return\cf1 \cf4 false\cf1
\par \b endif\b0
\par \cf3 return\cf1 \cf4 true\cf1
\par \b endfunction\b0
\par
\par \b function\b0 Trig_Give_Gold_Actions \b takes\b0 \cf2 nothing\cf1 \b returns\b0 \cf2 nothing\cf1
\par \cf3 call\cf1 \cf3 SetPlayerStateBJ\cf1\b (\b0 \cf3 GetTriggerPlayer\cf1\b ()\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1 , \b (\b0 \cf3 GetPlayerState\cf1\b (\cf3\b0 GetTriggerPlayer\cf1\b ()\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1\b )\b0 \cf3 -\cf1 \cf3 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b ))\b0 \b )\b0 \b )\b0
\par \cf3 call\cf1 \cf3 SetPlayerStateBJ\cf1\b (\b0 \cf3 ConvertedPlayer\cf1\b (\cf3\b0 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 6\cf1 , \cf3 7\cf1\b )))\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1 , \b (\b0 \cf3 GetPlayerState\cf1\b (\cf3\b0 ConvertedPlayer\cf1\b (\cf3\b0 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 6\cf1 , \cf3 7\cf1\b )))\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1\b )\b0 \cf3 +\cf1 \cf3 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b ))\b0 \b )\b0 \b )\b0
\par \cf3 call\cf1 \cf3 DisplayTextToForce\cf1\b (\b0 \cf3 GetForceOfPlayer\cf1\b (\cf3\b0 ConvertedPlayer\cf1\b (\cf3\b0 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 6\cf1 , \cf3 7\cf1\b ))))\b0 , \b (\b0 udg_PlayerName\b [\cf3\b0 GetConvertedPlayerId\cf1\b (\cf3\b0 GetTriggerPlayer\cf1\b ())]\b0 \cf3 +\cf1 \b (\b0 \cf5\i "has\cf1\i0 \cf5\i given\cf1\i0 \cf5\i you\cf1\i0 \cf5\i |cffffcc00"\cf1\i0 \cf3 +\cf1 \b (\b0 \cf3 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b )\b0 \cf3 +\cf1 \cf5\i "|r\cf1\i0 \cf5\i gold."\cf1\i0 \cf5\i )\cf1\i0 \cf5\i )\cf1\i0 \cf5\i )\cf1\i0 \cf5\i )\cf1\i0
\par \b endfunction\b0
\par
\par \cf6\i //===========================================================================\cf1\i0
\par \b function\b0 InitTrig_Give_Gold \b takes\b0 \cf2 nothing\cf1 \b returns\b0 \cf2 nothing\cf1
\par \cf3 set\cf1 gg_trg_Give_Gold \cf3 =\cf1 \cf3 CreateTrigger\cf1\b (\b0 \b )\b0
\par \cf3 call\cf1 \cf3 TriggerAddCondition\cf1\b (\b0 gg_trg_Give_Gold, \cf3 Condition\cf1\b (\b0 \b function\b0 Trig_Give_Gold_Conditions \b )\b0 \b )\b0
\par \cf3 call\cf1 \cf3 TriggerAddAction\cf1\b (\b0 gg_trg_Give_Gold, \b function\b0 Trig_Give_Gold_Actions \b )\b0
\par \b endfunction\cf0\b0
\par }

is that correct?? i put it into a new trigger so that is the whole trigger.

Is this correct?
THanks
 
Level 3
Joined
Mar 27, 2004
Messages
70
It looks a lot like you've used my editor to save it. It has some problems when saving to a file because it sometimes saves the RTF formatting tags too.
You should copy and paste the text in a way that the RTF tags will not appear.

Btw, make sure that the trigger you paste it into is called exactly "Give Gold" (case-sensitive).
 
Status
Not open for further replies.
Top