Bships Code Error

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Bships Code Error

Unread post by ikillforeyou »

hi guys, i've been working on a bships map and i ran into a snag.

i'm basically making boxes on the side of the map with "Empty slots" <small units with the scout tower's model> in them, 100 each.
What i want is that when you aquire an item, it takes an "Empty slot" from inside of the reigion corresponding to the player and to "Replace" it with an other tower with a diff model, these are to display the diff cannons you have.

This is the code, its not working

Code: Select all

Aquire Cannon
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Kid Cannon
            Then - Actions
                Unit - Add Kid Catapult  to (Triggering unit) <----- this isn't working aswell, i dont know why, Btw Kid Catapult is an ability based off of phoenix fire that shoots kid progectiles, yeah. its funny! :P
                Item - Remove (Item being manipulated)
                Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Picked unit)) matching ((Unit-type of (Picked unit)) Equal to Empty slot))) and do (Actions) <----- i figured out that the unit type comparison is the problem, any help?
                    Loop - Actions
                        Unit - Replace (Picked unit) with a Kid Cannon using The old unit's relative life and mana
            Else - Actions
                Custom script:   set bj_wantDestroyGroup = true

Code: Select all

Init
    Events
        Map initialization
    Conditions
    Actions
        Set RShip_Reigions[1] = P1Ship <gen>
        Set RShip_Reigions[2] = P2Ship <gen>
        Set RShip_Reigions[3] = P3Ship <gen>
        Set RShip_Reigions[4] = P4Ship <gen>
        Set RShip_Reigions[5] = P5Ship <gen>
        Set RShip_Reigions[6] = P6Ship <gen>
        Set RShip_Reigions[7] = P7Ship <gen>
        Set RShip_Reigions[8] = P8Ship <gen>
        Set RShip_Reigions[9] = P9Ship <gen>
        Set RShip_Reigions[10] = P10Ship <gen>

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post by 3ICE »

Creating 100 towers per player will result in 1200 units. That is three times the amount War3 can handle without crashing. (Think about pentium3 players please.)
You need to delete the entire system and invent a better one.
ikillforeyou wrote:

Code: Select all

            Else - Actions
                Custom script:   set bj_wantDestroyGroup = true
What is that supposed to do? Read a tutorial on memory leaks again, because you misunderstood it.

EDIT: Instead of t_uni Unit - Add Ability, you should have used t_ite Create Item and Give to Unit.
ImageImageImageImageImage
Image
ImageImage

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post by ikillforeyou »

here, try this map

this is reletively what i want to do
http://www.epicwar.com/maps/816/

and for the memory leaks. here's another one
http://world-editor-tutorials.thehelper ... view=27242

that answer your questions?

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post by 3ICE »

ikillforeyou wrote:and for the memory leaks. here's another one
http://world-editor-tutorials.thehelper ... view=27242
I asked you to read one, not link one.

As for your question, please come up with something original. Copying other maps' systems is lame, especially if they are protected.

I deprotected a weapon trigger. Copy it to your editor of choice and read it even if you don't understand jass.
Lines starting with // are comments and I wrote them for you (to explain what the line of code below the comment does):
The deprotected function The deprotected function

Code: Select all

// Start trigger action for Weapon Shotgun Team
function Trig_Weapon_Shotgun_Team_Actions takes nothing returns nothing

// If player has enough food, do
    if ( Trig_Weapon_Shotgun_Team_Func001C() ) then

// Create the weapon under the ship (u00Q = Shotgun Team dummy. In your case this will not be a unit, but an ability. Good luck figuring out how to sell abilities later.)
        call CreateNUnitsAtLoc( 1, 'u00Q', GetOwningPlayer(GetManipulatingUnit()), GetUnitLoc(GetManipulatingUnit()), bj_UNIT_FACING )

// Add the created weapon into the ShipCannons unit group array at the current player's index
        call GroupAddUnitSimple( GetLastCreatedUnit(), udg_PlayerShip_Cannons[GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))] )

// Replace a random weapon slot with Shotgun Team (n000 = circle of power aka weapon slot and n00S = Shotgun Team display dummy)
        call ReplaceUnitBJ( GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetManipulatingUnit()), 'n000')), 'n00S', bj_UNIT_STATE_METHOD_DEFAULTS )

// Ping the replaced unit for 2 seconds
        call PingMinimapLocForForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), GetUnitLoc(GetLastReplacedUnitBJ()), 2.00 )

// If player doesn't have enough food
    else

// Display the "Not enough food (aka weapon slots)" error message
        call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_1777" )

// And refund the item price (416 gold)
        call AdjustPlayerStateBJ( 416, GetOwningPlayer(GetManipulatingUnit()), PLAYER_STATE_RESOURCE_GOLD )

// endif...
    endif

// End trigger action
endfunction
p.s.: That map was fun. Had a lot of bugs though. Most annoying were: invisible weapons in the middle (the mapper forgot to handle leavers properly) and getting 6 unusable weapon slots, leaving me with -1 (food was 6used / 5available) Ships with negative weapon slots are pretty useless. But remaking solved the problem.
ImageImageImageImageImage
Image
ImageImage

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post by ikillforeyou »

OH MY GOSH! i just found the most perfect system for my map! ITS SOO PERFECT! but wow! i just found the most perfect system for the map i need a bit of help on how to make it compatible on what i want though. here's the site http://www.hiveworkshop.com/forums/reso ... 555&page=3

all i need is for that system to use passive items and some sort of finding custom value to set slots. also i need a trigger for when the player gets a ship with less cannons on the new ship then on the old one.

Btw, Thanks 3ice. your the reason i come to ur site and not the hive for advice :D

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post by ikillforeyou »

hey 3ice, is there a way i can use the system from the link above to use passive items? thanks.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post by 3ICE »

Have you even looked at it's screenshot? I think more than half of the items on it were passive.
Of course you can use passive items!
Most items in war3 only give a passive bonus so it would be silly for a system not to allow passive items.
ImageImageImageImageImage
Image
ImageImage

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post by ikillforeyou »

the guy in the system said that he didn't make passive items work or else you could of massed like 100 claws of attack. And thats because of the fact that you can hold all types of items but they dont give passive item bonuses

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post by 3ICE »

Ok, then it is time to find a better system. I also noticed on the screenshot that he had a Crown of Kings but the hero had no +5 stats. Same for all the other passive items he had.

Is there an option for turning passive item support on and off? I would have definitely put one if it was my system...
ImageImageImageImageImage
Image
ImageImage

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post by ikillforeyou »

are you sure you cant just look through the code and try to find a way to make it use passive items?

Post Reply

Who is online

Users browsing this forum: No registered users and 116 guests