Awesome 2d Rts Engine (similar To Warcraft/strcft)
#21
Posted 22 January 2010 - 01:36 AM
#22
Posted 23 January 2010 - 07:44 AM
Update has arrived!! refer to the first post for information
Edited by rude guss, 25 January 2010 - 04:04 AM.
#23
Posted 25 January 2010 - 04:43 PM
if build_target.is_built = false && build_target.is_placed = true
at position 26: Unknown variable is_built
that was in the update when i clicked on villager create
#24
Posted 25 January 2010 - 11:26 PM
simply there is a big house and a small one - you cant use the big one, just make your own
#25
Posted 26 January 2010 - 11:33 AM
thks alot for the engine, i got 1 request or question,
how can i add buy or sell npc? and the resource display kinda blured,,
some sprite example of my current project with your engine,
1. for now i have dificulty too add manual firing turrent at my sprite since the engine dint reconize the variable,
2. can you show me an example how to add buy and sell npc? so tht player can buy or sell stuff?
like buying a new ship or new turrent or new crew or even sell them, so when the player kills enemy they got a point and can trade for a new ship etc.
3. i'm trying to add custom quest mission, but still in learning progress,
i will show my mini project, when im done editing it.
thks in advance.
#26
Posted 26 January 2010 - 03:49 PM
sorry mate, i know what the problem is: the "peon house" that you tried to click on is obsolete - and i forgot to delete it so you have to use "obj_building_template" instead of "obj_peon_house"
simply there is a big house and a small one - you cant use the big one, just make your own
cheers.
#27
Posted 26 January 2010 - 11:49 PM
2. can you show me an example how to add buy and sell npc? so tht player can buy or sell stuff?
like buying a new ship or new turrent or new crew or even sell them, so when the player kills enemy they got a point and can trade for a new ship etc.
- creating the button -
go to the buttons folder and duplicate the object "obj_button_template"
rename the duplicated object (for reference ill call it button_buy_ship)
go to the "left click event" of "button_buy_ship"
this is where you put the code to what happens when you click the button
so something like:
if global.points >= 10
{
global.points -= 10;
instance_create(ship);
}
THEN
- assigning the button -
youll wnt to assign this button to a building - so go to the building object you want and go to the "create event"
down the bottom you will find variables relating to the HUD button slots
just enter in that button_buy_ship into one of those slots.
#28
Posted 28 January 2010 - 09:15 AM
#29
Posted 01 February 2010 - 03:50 AM
"
ERROR in
action number 1
of Step Event
for object obj_button_manager:
Error in code at line 49:
if obj_HUD.target.hud_gen_s1 != 99 { hud_gen_s1 = instance_create(-100,-100,obj_HUD.target.hud_gen_s1); hud_gen_s1.xpos = hud_slotx1; hud_gen_s1.ypos = hud_sloty1; }
^
at position 28: Unknown variable hud_gen_s1
"
"
ERROR in
action number 1
of Draw Event
for object obj_info_manager:
Error in code at line 4:
draw_text(view_xview[0]+namex-(string_width(obj_HUD.target.unit_name)/2),view_yview[0]+namey-(string_height(obj_HUD.target.unit_name)/2),obj_HUD.target.unit_name);
^
at position 65: Unknown variable unit_name
"
but it continued to work after I chose to ignore them. I did change the name in the unit_name variable in the execution code of the obj_unit_template .. am I supposed to change it somewhere else also?
Edited by stumlehb, 01 February 2010 - 03:58 AM.
#30
Posted 01 February 2010 - 06:00 AM
the problem is the units in the new version have more new variables than the ones that were in the old one, and some of the new hud elements require those new variables but cannot find them. what you can do to fix these errors is to compare the old create event with the new one and add the missing cariables yourself.
if a im totally of the mark, then can you tell me what to do to recreate these error messages.
#31
Posted 02 February 2010 - 12:59 AM
stumlehb - i have a feeling that you copy and pasted units from the old engine version (02.7) to the new engine (11.0).
the problem is the units in the new version have more new variables than the ones that were in the old one, and some of the new hud elements require those new variables but cannot find them. what you can do to fix these errors is to compare the old create event with the new one and add the missing cariables yourself.
if a im totally of the mark, then can you tell me what to do to recreate these error messages.
I did import them and checked them(hope I didn't miss anything though). I've been having some other error messages related to variables as well. but they seem to happen intermittently. for example it will say that the unit_hp variable for the enemies is not recognized, but I know that it is being used because I was able to kill some of those enemy units, before the error messages pop up for the same kind of unit later.. I'm wondering if it is a game maker bug of some sort, because I have had other random intermittent problems with game maker before.. for example, in another game, certain animations intermittently do not show all frames of animation, even though it shows all of them sometimes..
I'll try making all new objects from the templates again instead of using the imported ones...
#32
Posted 07 February 2010 - 03:36 AM
see first post for details
#33
Posted 08 February 2010 - 11:31 PM
#34
Posted 09 February 2010 - 09:05 AM
#35
Posted 10 February 2010 - 11:28 PM
I have a problem...
How can i make my Unit morph or Evolve into a new form with new skills?
Example:
First Form:Larva
Must Morph into Egg after 5 minutes...
Second Form:Creeps
And when i want it to build something it must morph into the building i want it to be!
How can i do this?
#36
Posted 11 February 2010 - 02:57 AM
*create*
alarm[7] = 5mins;
*alarm[7]*
im_pro = instance_create(x,y,obj_creep);
im_pro.selected = true;
selected = false;
instance_destroy();
for the next part just make it so when the creep builds a building it gets destroyed, and for the building:
*step*
if is_built = false
{
build_progress += 1(or a larger amount if you want it to be built faster)
}
#37
Posted 11 February 2010 - 06:39 AM
Finally fixed that thing!
#38
Posted 23 February 2010 - 11:12 PM
#39
Posted 25 August 2010 - 05:16 PM
ERROR in
action number 1
of Mouse Event for Left Pressed
for object Obj_Button_House:
Error in code at line 7:
if obj_HUD.target.is_built = true
^
at position 20: Unknown variable is_built
also if you could explain how to make it so when say i press the build worker button it subtracts 10 res3 from the stockpile and could you make a readme tutorial to better explain how to do everything
Edited by Snopel, 25 August 2010 - 08:57 PM.
#40
Posted 01 September 2010 - 12:22 AM
also if you could explain how to make it so when say i press the build worker button it subtracts 10 res3 from the stockpile and could you make a readme tutorial to better explain how to do everything
add stuff in the obj_button_worker 'left pressed' event. here is an example of a button that builds a monk in my game and
//clicking effect - start
spr_state = 1;
alarm[0] = 1;
//clicking effect - end
//your own code to what happens when you press this button
if obj_building_template.make_progress = 0
{
if obj_resource_manager.res1 >= 100
{
obj_resource_manager.res1 -= 100;
if obj_HUD.target.is_built = true
{
obj_HUD.target.make_power = 20;
obj_HUD.target.make_object = obj_unit_monk;
obj_HUD.target.make_time = true;
}
}
}
here it is again with a different unit:
//your own code to what happens when you press this button
if obj_building_template.make_progress = 0
{
if obj_resource_manager.res2 >= 100 && obj_resource_manager.res3 >= 10
{
obj_resource_manager.res2 -= 100;
if obj_HUD.target.is_built = true
{
obj_HUD.target.make_power = 20;
obj_HUD.target.make_object = obj_unit_bar2;
obj_HUD.target.make_time = true;
}
}
}
not sure about your is_built problem.. how do you know what the target of the hud is? I'm guessing its not what you think it is at that moment.. but maybe you just need to add an is_built variable somewhere?
Edited by stumlehb, 01 September 2010 - 12:24 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











