wc3edit.net

United Warcraft 3 map hacking!
It is currently April 27th, 2024, 4:32 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [HELP]Gold/Lumber Rate
PostPosted: June 9th, 2013, 6:51 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
How to make custom commands to set gold/lumber rate for player?


Top
 Profile  
 
PostPosted: June 9th, 2013, 7:50 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Ill explain the way I made for gold rate and you can mske it into lumber.

Make an integer variable holding the current amount of gold (make sn array if you want it for more than one player)

Make a trigger running everytime the gold amount changes.

Compare the new gold amount to the old gold amount.

If you see the gold increased, add more gold to the triggering player.
Make sure you disable the trigger before you add the gold so the trigger won't run infinitely. And turn it on when it's finished.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: June 10th, 2013, 2:36 am 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
thanks Hax , I'll try now thanks for helping me .


Top
 Profile  
 
PostPosted: June 10th, 2013, 5:48 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
haxorico wrote:
Ill explain the way I made for gold rate and you can mske it into lumber.

Make an integer variable holding the current amount of gold (make sn array if you want it for more than one player)

Make a trigger running everytime the gold amount changes.

Compare the new gold amount to the old gold amount.

If you see the gold increased, add more gold to the triggering player.
Make sure you disable the trigger before you add the gold so the trigger won't run infinitely. And turn it on when it's finished.


I create one integer variable with name Gold_Check then I set Gold_Check[triggerplayer...]=triggerplayer... current gold. As you said make trigger running everytime, I don't know what events I should choose. If I choose event every seconds, it's can't be use with triggerplayer.
And I think need to create 2 integer variables to holding amount of gold. 1 holding old gold amount , 1 holding new gold amount, then compare it. I'm understand what you says but I don't know how to make it. @@. I'm still noob.


Top
 Profile  
 
PostPosted: June 11th, 2013, 5:07 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
There is an event regarding the resources changed. You can look at any rate edit cheatpack like sgguy fukki and mine.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: June 11th, 2013, 4:20 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Code:
globals
integer array VmFai
trigger array u7g_tmTp7
endglobals

function GoldConD takes player u7g_pp9,integer u7g_ii7,integer u7g_ss9 returns nothing
local integer u7g_ft7=VmFai[u7g_ii7+55]*(u7g_ss9-VmFai[u7g_ii7+79])
local integer u7g_goldwhee=u7g_ss9+u7g_ft7*3/20
call SetPlayerState(u7g_pp9,PLAYER_STATE_RESOURCE_GOLD,u7g_goldwhee)
endfunction

function Sg_Gold_hi7 takes nothing returns boolean
local playerstate u7g_bb9=PLAYER_STATE_RESOURCE_GOLD
local player u7g_pp9=GetTriggerPlayer()
local integer u7g_ii7=GetPlayerId(u7g_pp9)
local integer u7g_ss9=GetPlayerState(u7g_pp9,u7g_bb9)
if u7g_ss9>VmFai[u7g_ii7+79]then
if u7g_ss9-VmFai[u7g_ii7+79]>1then
call DisableTrigger(GetTriggeringTrigger())
call GoldConD(u7g_pp9,u7g_ii7,u7g_ss9)
set u7g_ss9=GetPlayerState(u7g_pp9,u7g_bb9)
call EnableTrigger(GetTriggeringTrigger())
endif
endif
set VmFai[u7g_ii7+79]=u7g_ss9
set u7g_pp9=null
set u7g_bb9=null
return false
endfunction

function Sg_Gold_Selection_Actions takes nothing returns nothing
local integer u7g_id5=GetPlayerId(GetTriggerPlayer())+48
local integer u7g_mnG=13
loop
exitwhen u7g_mnG>17
set u7g_tmTp7[u7g_id5]=CreateTrigger()
call TriggerAddCondition(u7g_tmTp7[u7g_id5],Condition(function Sg_Gold_hi7))
set VmFai[GetPlayerId(GetTriggerPlayer())+79]=GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)
call TriggerRegisterPlayerStateEvent(u7g_tmTp7[u7g_id5],GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,GREATER_THAN_OR_EQUAL,0)
set VmFai[GetPlayerId(GetTriggerPlayer())+55]=u7g_mnG-12
set u7g_mnG=u7g_mnG+1
endloop
endfunction

I'm extracted from SgGuyCP, it's working but when I killing unit, my resource gold will set to 10000000.
Please check my mistake. Thanks.


Last edited by zUsername on June 11th, 2013, 5:14 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: June 11th, 2013, 4:53 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
A) If you post a code, please use the [code] tag
B) Reading from sgguy cp (and fai) is rather difficult for me as the variables have weird names so I will need to get home to read it properly.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: June 11th, 2013, 5:15 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Ok, I'll wait for you . Thanks Hax.


Top
 Profile  
 
PostPosted: June 14th, 2013, 8:36 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Brief look and it seems you left out some parts.
What is calling the function sg_gold_selection_action

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: June 14th, 2013, 9:28 am 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
function main Hax


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)