HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Somthink sux with integer

07-29-2007, 09:51 AM#1
teddybear
I creating a new ORPG map and i planning to add to ther profession but i have serius problem,please can anyone find the bug/miss in my next scripts?


The demo profession: Blacksmith
Include:Gathering and Crafting

The gathering skill trigger:

Trigger:
Prob 1
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Mine
(Unit-type of (Target unit of ability being cast)) Equal to Little Mine
Collapse Actions
Set Prof_BS_GatherSkill[(Player number of (Owner of (Triggering unit)))] = (Prof_BS_GatherSkill[(Player number of (Owner of (Triggering unit)))] + (Random integer number between 1 and 2))
Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cffc3dbffYour skill in Ore Gathering increased to|r + (String(Prof_BS_GatherSkill[(Player number of (Owner of (Triggering unit)))])))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 100) Less than or equal to 85
Collapse Then - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffc3dbffYou have ...
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 100) Less than or equal to 76
Collapse Then - Actions
Set Prof_BS_Copper[(Team number of (Owner of (Triggering unit)))] = (Prof_BS_Copper[(Team number of (Owner of (Triggering unit)))] + (Random integer number between 1 and 3))
Else - Actions
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 100) Greater than or equal to 28
Collapse Then - Actions
Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
Unit - Remove (Target unit of ability being cast) from the game
Else - Actions


This trigger add 1-3 Copper Ores (Integer)

And then when i want to use the collected Ores (Integers) i tring to use that trigger to craft Copper Boots (Require 6 Copper Ore (Integer)):



Trigger:
Prob 2
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to |cff7D26CDCraft- Copper Boots
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Prof_BS_Copper[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 6
Collapse Then - Actions
Set Prof_BS_Baseskill[(Player number of (Owner of (Triggering unit)))] = (Prof_BS_Baseskill[(Player number of (Owner of (Triggering unit)))] + (Random integer number between 3 and 6))
Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cffc3dbffYour skill in Blacksmith increased to|r + (String(Prof_BS_Baseskill[(Player number of (Owner of (Triggering unit)))])))
Set Prof_BS_Copper[(Team number of (Owner of (Triggering unit)))] = (Prof_BS_Copper[(Team number of (Owner of (Triggering unit)))] - 6)
Hero - Create Copper Boots and give it to (Triggering unit)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Prof_BS_Copper[(Player number of (Owner of (Triggering unit)))] Less than 6
Collapse Then - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: You dont have the metarials!
Else - Actions


And the problem with this is that when i use the Craft- Copper Boots skill,its says "You dont have the metarials!" like i dont have 6 Copper Ores (Integer) that i collected,but i do...

Can anyone find the crappy bug.miss here? please help people,if i dont have that trigger working so i dont have profession in my map at all...
07-29-2007, 10:31 AM#2
Histenchist
Well since you use Set Prof_BS_Copper[(Team number of (Owner of (Triggering unit)))] = (Prof_BS_Copper[(Team number of (Owner of (Triggering unit)))] + (Random integer number between 1 and 3))
Else - Actions, you might want to know that the team number starts on 0 same with players
Player 1: 0
Player 2: 1
And
Team 1: 0
Team 2: 1
07-29-2007, 10:45 AM#3
teddybear
So what should i change here?
07-29-2007, 04:36 PM#4
Naakaloh
I think he's referring to the first part where you use "Team number of triggering unit" instead of "Player number of triggering unit" for the index of your array, but then your condition in the second trigger uses "Player number"; You do something similar in the second part too when you're subtracting "ore." Basically; whereever you see "Team number" replace it with "Player number."

Edit: "Materials" is the correct spelling.
07-30-2007, 06:49 AM#5
teddybear
OMFG how could i miss it~?!? lol thanks guys xD