If you have not done so already, take some time to familiarize yourself with all the available functions. If you do not know what building blocks you have, you can't start building.
if you've ever taken a class on programming, especially OO programming, you'll know what he means. otherwise, the word "flowchart" should open up your third eye a bit...
First you need to describe what you want to accomplish.
"I want to make a trigger that gives you control of a building when you bring a unit near it, but only if no other player has a unit near it."
Then, divide this into parts.
WHEN a player brings a unit near the building,
IF no other player has a unit near the building,
THEN give control of building to player who has unit by it.
Identify what is an event, condition and action.
Event is what should make the trigger run. It's something that happens the game can check for. In this case, when a player brings a unit near the building. The WHEN is a keyword here, this can usually lead you to finding the event.
Conditions are what need to be fulfilled in order for actions to be performed. Here, no other player should have a unit near the building. Look for the IFs.
The actions are what you want to do when conditions are met. That is, to give the building to the player.
After that it's just a matter of finding the appropriate Events/Conditions/Actions in the list when implementing the trigger, but the descriptions and categories should help with that. Some other specific knowledge will help too, for example in my trigger you should have placed a Region around the building, since Regions define parts of the map where you want to check for things or do things. I suppose you could call that a WHERE.
Don't know if this was helpful, but it's hard to explain how to think like a programmer when it comes naturally to me.
Same problem here.. I'm assuming here you mean overwhelm by the complexity and tediousness associated with triggers. It can be rather astounding.. If not, disregard my post.
If you're willing to go the extra mile.. Try learn galaxy. When you're familiar with it, coding becomes much faster.. It doesn't take 15-30 seconds to create one variable. *click click click* Just type int i = YourNumber
wtf :) bring on paper what you are trying to do before you actually start programming. this is the second step in software engineering after the discussion with the customer/pr boss. it is the step before you touch the code.
even a simple what to do list is fine, start with the main features and split them up into smaller solvable problems. I don't use this method very often while mapping, it is something pretty small my brain can handle xD
I'm using the list only to remember features the other day if I have to go to sleep and no time to continue until the next evening.
going to check if I find something I can show you.
paper is patient and helps a lot if programming is not your every day business
@FuzzYD: Go
the gui is not that bad and pretty fast if you learn it rigth. a variable only takes 1 key stroke and 1 mouse klick lol doesn't even take 3 seconds. you have to type the type
My least favourite part is having to go
THIS IS THIS. THIS THIS IS THIS. THIS THIS THIS IS THIS THIS THIS.
Its like, really? How many times do I have to determine what I want linked together before you can follow the stupid link.
Recently I Had an issue with a trigger in which I wanted a unit to spawn at a location, if a computer player was in that location.
Guess how many times I had to tell the trigger which location. :'D
@Dalemil: Go
Try learn galaxy. When you're familiar with it, coding becomes much faster.. It doesn't take 15-30 seconds to create one variable. *click click click* Just type int i = YourNumber
You can declare vars in galaxy? Maybe you do it in a diff way, but I add the General->Custom Script action in a trigger and code there. That doesn't let me declare any variables.
To the OP, as you get more familiar with what functions are where, the GUI editor gets less tedious because you aren't spending so much time looking for the function you want.
You can declare vars in galaxy? Maybe you do it in a diff way, but I add the General->Custom Script action in a trigger and code there. That doesn't let me declare any variables.
Don't create a trigger, create a custom script object.
In a trigger, you cannot create variables, because you are in the midst of a function, and galaxy does only allow declaration of variables outside of a function (global) or at the beginning of a function (local).
I've always considered myself to be a terrible teacher, though. Sometimes explanations just come to you, when you have time to think about it for a while, but there's no way I'd be able to explain everything immediately. And if the first explanation doesn't work, well, then you're stumped.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
creating triggers can quickly overwhelm me. does anyone else have this problem?
Patience, young grasshopper. Patience and persistence.
get a sheet of paper and sketch what you're trying to do
@b0ne123: Go
What do you mean sketch? I'm asking this seriously as I also feel the same way as op sometimes.
If you have not done so already, take some time to familiarize yourself with all the available functions. If you do not know what building blocks you have, you can't start building.
thank you for the very useful suggestions
also b0ne123, show us some of your sketches so that we may know how to go about such a thing, lol
@Dalemil: Go
if you've ever taken a class on programming, especially OO programming, you'll know what he means. otherwise, the word "flowchart" should open up your third eye a bit...
First you need to describe what you want to accomplish.
"I want to make a trigger that gives you control of a building when you bring a unit near it, but only if no other player has a unit near it."
Then, divide this into parts.
WHEN a player brings a unit near the building, IF no other player has a unit near the building, THEN give control of building to player who has unit by it.
Identify what is an event, condition and action.
Event is what should make the trigger run. It's something that happens the game can check for. In this case, when a player brings a unit near the building. The WHEN is a keyword here, this can usually lead you to finding the event.
Conditions are what need to be fulfilled in order for actions to be performed. Here, no other player should have a unit near the building. Look for the IFs.
The actions are what you want to do when conditions are met. That is, to give the building to the player.
After that it's just a matter of finding the appropriate Events/Conditions/Actions in the list when implementing the trigger, but the descriptions and categories should help with that. Some other specific knowledge will help too, for example in my trigger you should have placed a Region around the building, since Regions define parts of the map where you want to check for things or do things. I suppose you could call that a WHERE.
Don't know if this was helpful, but it's hard to explain how to think like a programmer when it comes naturally to me.
@Dalemil: Go
Same problem here.. I'm assuming here you mean overwhelm by the complexity and tediousness associated with triggers. It can be rather astounding.. If not, disregard my post.
If you're willing to go the extra mile.. Try learn galaxy. When you're familiar with it, coding becomes much faster.. It doesn't take 15-30 seconds to create one variable. *click click click* Just type int i = YourNumber
I admire anyone who uses GUI for their patience..
wtf :) bring on paper what you are trying to do before you actually start programming. this is the second step in software engineering after the discussion with the customer/pr boss. it is the step before you touch the code.
even a simple what to do list is fine, start with the main features and split them up into smaller solvable problems. I don't use this method very often while mapping, it is something pretty small my brain can handle xD
I'm using the list only to remember features the other day if I have to go to sleep and no time to continue until the next evening.
going to check if I find something I can show you.
paper is patient and helps a lot if programming is not your every day business
@FuzzYD: Go the gui is not that bad and pretty fast if you learn it rigth. a variable only takes 1 key stroke and 1 mouse klick lol doesn't even take 3 seconds. you have to type the type
Yup. Its a huge convoluded pain in the ass.
My least favourite part is having to go THIS IS THIS. THIS THIS IS THIS. THIS THIS THIS IS THIS THIS THIS.
Its like, really? How many times do I have to determine what I want linked together before you can follow the stupid link.
Recently I Had an issue with a trigger in which I wanted a unit to spawn at a location, if a computer player was in that location. Guess how many times I had to tell the trigger which location. :'D
You can declare vars in galaxy? Maybe you do it in a diff way, but I add the General->Custom Script action in a trigger and code there. That doesn't let me declare any variables.
To the OP, as you get more familiar with what functions are where, the GUI editor gets less tedious because you aren't spending so much time looking for the function you want.
Don't create a trigger, create a custom script object.
In a trigger, you cannot create variables, because you are in the midst of a function, and galaxy does only allow declaration of variables outside of a function (global) or at the beginning of a function (local).
@Nashadun: Go
dude, you should be a teacher, ive been trying for months to figure this things out and your explanation just made everything make a LOT more sense
@Conradjd: Go
I've always considered myself to be a terrible teacher, though. Sometimes explanations just come to you, when you have time to think about it for a while, but there's no way I'd be able to explain everything immediately. And if the first explanation doesn't work, well, then you're stumped.