Question for triggers and others

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Question for triggers and others

Post by Syre »

For the farming, i have no idea whats going on..so please either post your map or send it to me in a PM so i can take a look at what is happening.

Without creating an entire system, a spellbook is what your looking for. http://www.thehelper.net/threads/how-to ... oks.27637/

For the heros[0], im sorry but it seems i completely skipped over that somehow. Yes, that is a unit variable with an array of 11..or however many players you have set. From the questions im getting im guessing your making an RPG of some sort..so for the heros variable add something like

Code: Select all

Set Heros[(Player number of (Owner of (Last Created Unit)))] = (Last created unit)
in the trigger that makes the hero when its picked. What this will do is that when someone picks a hero, red in this example, it will set Heros[0] to the hero that was just created, so you can use that in other triggers to add spells or such to him.

It will only require a bit of simple editing. First create a new interger variable, this will be used as a random number to see which fish you get. Then edit the trigger Casts Fishing, under the line

Code: Select all

-------- It then creates a fish in the Triggering Unit's inventory based on which fish is being targeted. --------
add a new action

Code: Select all

Set FishInt = (Random integer number between 1 and 3)
Where fishint is the interger you made and the number is how many fish you want.
Now in the original trigger we have two units for the fish, Green Fish and School of Fish..since we are randomizing it we only need one, in the example ive only used School of Fish. All you need to do to make it random is that under the conditions is to check which number it is.

Code: Select all

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Unit-type of (Target unit of ability being cast)) Equal to School of Fishs
        FishInt Equal to 1
    Then - Actions
        Hero - Create Green Fish and give it to (Triggering unit)
    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Target unit of ability being cast)) Equal to School of Fishes
                FishInt Equal to 2
            Then - Actions
                Hero - Create Anchovy and give it to (Triggering unit)
            Else - Actions
Ive got no idea for the horses sorry..you should look into morphing though as it would be your best bet. http://www.thehelper.net/threads/morphing-heroes.24542/
Image
dragon_zero96
Member
Posts: 99
Joined: May 30th, 2011, 10:28 am

Re: Question for triggers and others

Post by dragon_zero96 »

Here is my map its not done with the terrain cause may terrain maker is busy so what you see is what i have done
You do not have the required permissions to view the files attached to this post.
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Question for triggers and others

Post by Syre »

Alright, i found out whats wrong. When i made the trigger i wasn't sure how you were going to add the corn..the way i made it was with a unit that gets spawned when its used, but your using a building. So not only does it spawn a building from my trigger, it builds one from the item itself which is why there is two. So i just changed the first trigger a bit

Code: Select all

Corn Seed
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Constructed structure)) Equal to Corn Seed
    Actions
        Unit - Add a 5.00 second Generic expiration timer to (Constructed structure)
Simpler now, just adds a timer to when the building gets done.

Edit : Took a look at the other triggers while i was at is..i know for the fishing one you said you are going to have it random so you might want to change some stuff around such as these

In Initialization

Code: Select all

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Picked unit)) Equal to School of Fishes
                (Unit-type of (Picked unit)) Equal to Green Fish
    Then - Actions
        -------- This line sets the amount of fishes to a fish. --------
        Hashtable - Save DefautAmount as 0 of (Key (Picked unit)) in FSHT
        -------- This floating text shows how much fishes it has left. --------
        Floating Text - Create floating text that reads (String((Load 0 of (Key (Picked unit)) from FSHT))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        -------- This line saves the floating text so, that it can be changed when someone fishes from a fish. --------
        Hashtable - Save Handle Of(Last created floating text) as 1 of (Key (Picked unit)) in (Last created hashtable)
        -------- Special effects things go here. --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Picked unit)) Equal to School of Fishes
            Then - Actions
                Special Effect - Create a special effect attached to the overhead of (Picked unit) using Doodads\Ruins\Water\FishSchool\FishSchool.mdl
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Green Fish
                    Then - Actions
                        Special Effect - Create a special effect attached to the overhead of (Picked unit) using Doodads\Ruins\Water\FishTropical\FishTropical.mdl
                    Else - Actions
    Else - Actions
In Fishes Recovery

Code: Select all

If - Conditions
    (Load 0 of (Key (Picked unit)) from FSHT) Less than Max
    Or - Any (Conditions) are true
        Conditions
            (Unit-type of (Picked unit)) Equal to School of Fishes
            (Unit-type of (Picked unit)) Equal to Green Fish
Both uses school of fishes and green fish..if you are removing one you may want to change your trigger around so either there is only one effect or that it works by which fish you get, not which spot you fish in.
Image
dragon_zero96
Member
Posts: 99
Joined: May 30th, 2011, 10:28 am

Re: Question for triggers and others

Post by dragon_zero96 »

Do i add this trigger? or edit the old one?

Code: Select all

Corn Seed
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Constructed structure)) Equal to Corn Seed
    Actions
        Unit - Add a 5.00 second Generic expiration timer to (Constructed structure)
So whats the new trigger for is it for the random fish in a fishing spot?
and how do u make a trigger that makes the fisherman miss sometimes when he fishes

and what do i do with dis?

Code: Select all

If - Conditions
    (Load 0 of (Key (Picked unit)) from FSHT) Less than Max
    Or - Any (Conditions) are true
        Conditions
            (Unit-type of (Picked unit)) Equal to School of Fishes
            (Unit-type of (Picked unit)) Equal to Green Fish
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Question for triggers and others

Post by Syre »

dragon_zero96 wrote:Do i add this trigger? or edit the old one?
Edit the old one, or add it and delete the old one..either way.
dragon_zero96 wrote:So whats the new trigger for is it for the random fish in a fishing spot?
I already explained how to add randomness to the fishing trigger, its in an above post, re-read that. Your basicly making an interger variable random each time the spell is used..if one of the numbers is hit they get a fish.
dragon_zero96 wrote:and how do u make a trigger that makes the fisherman miss sometimes when he fishes
Using the changes that i made above just make it a higher number..I used an example of 1 to 3 and there are only 2 fish, meaning that there is a 1/3 percent chance that it will miss and no fish will be got.
dragon_zero96 wrote:and what do i do with dis?

Code: Select all

If - Conditions
    (Load 0 of (Key (Picked unit)) from FSHT) Less than Max
    Or - Any (Conditions) are true
        Conditions
            (Unit-type of (Picked unit)) Equal to School of Fishes
            (Unit-type of (Picked unit)) Equal to Green Fish
Simple, since you are going to make only one type of fishing spot just remove one..Lets say you make the trigger revolve around School of Fishes..the green fish part is no longer needed in any trigger since its not being used.
Image
dragon_zero96
Member
Posts: 99
Joined: May 30th, 2011, 10:28 am

Re: Question for triggers and others

Post by dragon_zero96 »

hmm where do i add when they miss its going to say the fish got away?

got a problem with the corn, after it turn to an item it, when the corn(item) is pick up there is the corn still there i mean the shadow or i dont know what you call it. and how do u make the building time longer? is it at object editor? or it a trigger 2?
Last edited by dragon_zero96 on August 17th, 2012, 3:07 pm, edited 1 time in total.
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Question for triggers and others

Post by Syre »

Syre wrote:

Code: Select all

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Unit-type of (Target unit of ability being cast)) Equal to School of Fishs
        FishInt Equal to 1
    Then - Actions
        Hero - Create Green Fish and give it to (Triggering unit)
    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Target unit of ability being cast)) Equal to School of Fishes
                FishInt Equal to 2
            Then - Actions
                Hero - Create Anchovy and give it to (Triggering unit)
            Else - Actions
Right at the bottom after you've made every fish. afer Else - Actions add the message.
Image
dragon_zero96
Member
Posts: 99
Joined: May 30th, 2011, 10:28 am

Re: Question for triggers and others

Post by dragon_zero96 »

got a problem with the corn, after it turn to an item it, when the corn(item) is pick up there is the corn still there i mean the shadow or i dont know what you call it. and how do u make the building time longer? is it at object editor? or it a trigger 2?

Dude can you repost full fish trigger cause i getting dizzy -.- !
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Question for triggers and others

Post by Syre »

Haha, the full fish trigger is above..thats all the changes you need is to make a interger variable, and add this condition to each fish..of course making the number different for each fish.

Code: Select all

        FishInt Equal to 1
. Since your on at this time go into the chat, i can help you out without making this thread huge. Chat button is at top, right of where it says your logged in.
Image
dragon_zero96
Member
Posts: 99
Joined: May 30th, 2011, 10:28 am

Re: Question for triggers and others

Post by dragon_zero96 »

Here it is
You do not have the required permissions to view the files attached to this post.