www.gmindo.web.id/forum
Forum ini sudah tidak dipakai lagi. Silakan ke forum baru di www.gmindo.web.id/forum Very Happy

Terima kasih

Join the forum, it's quick and easy

www.gmindo.web.id/forum
Forum ini sudah tidak dipakai lagi. Silakan ke forum baru di www.gmindo.web.id/forum Very Happy

Terima kasih
www.gmindo.web.id/forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

game tower defense

4 posters

Halaman 1 dari 4 1, 2, 3, 4  Next

Go down

game tower defense Empty game tower defense

Post by adamas galleh mulyawan Tue 07 May 2013, 15:42

ask......... javascript:emoticonp('confused')agan2 yg cakep n chantik2, aq lg butuh bantuan ni....
aq lagi buat game tower defense buat UAS tapi towernya dkasih kecerdasan buatan(AI) bisa miih musuh berdasarkan HP terkecil jarak yg dekat dg tower trus speed yg tinggi ada yg tau caranya g gmna seleksi enemy berdasarkan HP(Health Point) pokoknya yg terkecil yg dtembak....... plis bantu ya ane pake javascript:emoticonp('Game Maker 8')
javascript:emoticonp('Mewek')
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Tue 07 May 2013, 19:52

Salah Kamar

Code:
target = min(obj_enemy_parent).HP
direction = point_direction(x,y,target.x,target.y)

semua enemy harus di ksih parent, di kode tsb, nama parent ny yaitu "obj_enemy_parent" Very Happy
Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 08 May 2013, 10:07

thanks sebelumnya
trus untuk mencari speed yg terkecil apa sama gan...???
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Wed 08 May 2013, 10:19

sama kalo script di atas work Razz
cz ak blum tes script ny work atau gk, hehehe

kalo work, tinggal gnti HP jadi speed

EDIT:
eh wait, nampak ny ad yg salah di script di atas, ak coba ralat lgi

EDIT:

nih, kalo enemy kmu cma sdikit, bisa pke ini

Step event:
Code:
if instance_exists(object0) {obj0 = object0.HP c[object0.HP] = object0} else obj0 = 999
if instance_exists(object1) {obj1 = object1.HP c[object1.HP] = object1} else obj1 = 999
if instance_exists(object2) {obj2 = object2.HP c[object2.HP] = object2} else obj2 = 999
if instance_exists(object3) {obj3 = object3.HP c[object3.HP] = object3} else obj3 = 999
if instance_exists(object4) {obj4 = object4.HP c[object4.HP] = object4} else obj4 = 999

    if HP !=0 && !(obj0=999 && obj1=999 && obj2=999 && obj3=999 && obj4=999)
    {
    a = min(obj0,obj1,obj2,obj3,obj4)
    move_towards_point(c[a].x,c[a].y,3)
    }
    else speed =0

gnti object0...object4 dgn nama enemy, dan gnti HP dgn variable hp kmu
Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Asuna Wed 08 May 2013, 10:40

kayanya ribet harus tulis objectnya satu per satu, coba sebutin dulu urutan prioritasnya gimana, apakah yang HPnya terkecil dulu atau apa? Hammer

coba kalo ada kasus begini, mana yang harus dipilih duluan, dan sebutin urutannya?
1. HP = 95, jarak = 600, speed = 2
2. HP = 100, jarak = 20, speed = 5
3. HP = 300, jarak = 10, speed = 1
(asumsi range towernya 800)
you must know it well before we can help you Razz
Asuna
Asuna
Global Moderator
Global Moderator

100%
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 08 May 2013, 10:49

gini mas maksudQ tiap enemy dihitung HP enemyXJarak enemy/kecepatanenemy jadi tower mengitung hp enemy dikali jarak enemy dg tower trus dibagi speed enemy dicari hasil yg terkecil itu yg ditembak tower mas....??
enemynya cuma 5macem mas....
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Wed 08 May 2013, 10:59

sama aja kondisi ny, tinggal di ubah aja

Code:
if instance_exists(object0) {obj0 = object0.HP*distance_to_object(object0)/object0.speed c[object0.HP*distance_to_object(object0)/object0.speed] = object0} else obj0 = 999

biar mudah & gk panjang, di bikin sebuah script aja, beri nama sc_target

di sc_target, script ny:

Code:
return argument0.HP*distance_to_object(argument0)/argument0.speed ;

jadi, ini script yg udh jadi Very Happy

Code:
if instance_exists(object0) {obj0 = sc_target(object0) c[sc_target(object0)] = object0} else obj0 = 999
if instance_exists(object1) {obj1 = sc_target(object1) c[sc_target(object1)] = object1} else obj1 = 999
if instance_exists(object2) {obj2 = sc_target(object2) c[sc_target(object2)] = object2} else obj2 = 999
if instance_exists(object3) {obj3 = sc_target(object3) c[sc_target(object3)] = object3} else obj3 = 999
if instance_exists(object4) {obj4 = sc_target(object4) c[sc_target(object4)] = object4} else obj4 = 999

    if HP !=0 && !(obj0=999 && obj1=999 && obj2=999 && obj3=999 && obj4=999)
    {
    a = min(obj0,obj1,obj2,obj3,obj4)
    move_towards_point(c[a].x,c[a].y,3)
    }
    else speed =0


Terakhir diubah oleh Kevin Blaze Coolerz tanggal Wed 08 May 2013, 11:22, total 1 kali diubah
Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 08 May 2013, 11:02

makasi ya hehehehehe............ Jempol2
oce mas aq coba dulu dech............
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Wed 08 May 2013, 11:02

seep, silakan Very Happy
good luck Smile
Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Tue 21 May 2013, 19:12

bentar mas @Kevin Blaze Coolerz & @asuna ane mw tanya lagi ni.... lumayan banyak..... hehehehehe... boleh to.....??
1. untuk seleksi musuh berdasarkan HPnya yg bagus itu yg lemah apa yg kuat ya...??
2. untuk seleksi musuh berdasarkan speednya yg bagus itu yg cepet apa yg lambat ya...??
3. untuk seleksi musuh berdasarkan jarak musuh bagusnya jarak musuh dengan tower apa jarak musuh dg titik goal ya buat seleksi tembaknya...??
thanks... bantuin ya......
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Asuna Tue 21 May 2013, 19:48

1. pilih yang kuat dan susah untuk dihancurkan game tower defense 4237465583
2. pilih yang cepat dan udah hampir sampe ke goal game tower defense 4237465583
3. terserah, dua2nya sama2 bagus game tower defense 4237465583

If you find this isn't good, think by yourself which is the best or try some experiments by yourself, since we should only help you for technical/implementation problems game tower defense 4237465583
Asuna
Asuna
Global Moderator
Global Moderator

100%
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 22 May 2013, 21:45

mas @Kevin Blaze Coolerz mw tanya script diatas kan ditaruh dstep events la aq gabungin ma step eventsku kok malah eror gini script step eventsQ tolong bantu y....... plisss....

if (active=0)
{
x=mouse_x;
y=mouse_y;
move_snap(16,16);
}
else
//Check if enemies are in range and activate firing if needed
{
if firing > 0 firing += 1;
if firing >= 30/rate firing = 0;
if not instance_exists(target) target = noone;
if instance_exists(ob_enemy)
{
if target = noone target = instance_nearest(x,y,ob_enemy);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}
if firing = 1 depth = -3;
else depth = -2;
}
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Asuna Wed 22 May 2013, 21:52

^
entah mana yang error, tapi menurutku aja buat statement if mending pake kurung utk menghindari kesalahan

or maybe either variable firing, target, ob_enemy or range isn't initialized before.. it's most likely at that Curiga
Asuna
Asuna
Global Moderator
Global Moderator

100%
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 22 May 2013, 22:05

@asuna sudah kok ini

// Initialise all variables
{
firing = 0;
target = noone;
active = 1; // indicates whether the tower should fire or not
range = 130;
rate = 3;
//rate=2;
damage = 10;
price = 100;
name = 'Laser'; // tower name
coll_path = 0; // indicates a possible collision
selected = 0; // indicates whether selected
level = 0; // indicates tower level
slow = 0.01;
}

la aq mw tanya klo scriptnya mas @Kevin Blaze Coolerz

if instance_exists(object0) {obj0 = sc_target(object0) c[sc_target(object0)] = object0} else obj0 = 999
if instance_exists(object1) {obj1 = sc_target(object1) c[sc_target(object1)] = object1} else obj1 = 999
if instance_exists(object2) {obj2 = sc_target(object2) c[sc_target(object2)] = object2} else obj2 = 999
if instance_exists(object3) {obj3 = sc_target(object3) c[sc_target(object3)] = object3} else obj3 = 999
if instance_exists(object4) {obj4 = sc_target(object4) c[sc_target(object4)] = object4} else obj4 = 999

if HP !=0 && !(obj0=999 && obj1=999 && obj2=999 && obj3=999 && obj4=999)
{
a = min(obj0,obj1,obj2,obj3,obj4)
move_towards_point(c[a].x,c[a].y,3)
}
else speed =0

mau aq gabungin ma scriptQ dtaruh dmananya ya.....?? ini scriptKu

if (active=0)
{
x=mouse_x;
y=mouse_y;
move_snap(16,16);
}
else
//Check if enemies are in range and activate firing if needed
{
if firing > 0 firing += 1;
if firing >= 30/rate firing = 0;
if not instance_exists(target) target = noone;
if instance_exists(ob_enemy)
{
if target = noone target = instance_nearest(x,y,ob_enemy);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}
if firing = 1 depth = -3;
else depth = -2;
}
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Fri 24 May 2013, 12:28

Sebelum ny kmu backup dulu gmk nya....

pada kode ku yg ini

Code:
if instance_exists(object0) {obj0 = sc_target(object0) c[sc_target(object0)] = object0} else obj0 = 999
if instance_exists(object1) {obj1 = sc_target(object1) c[sc_target(object1)] = object1} else obj1 = 999
if instance_exists(object2) {obj2 = sc_target(object2) c[sc_target(object2)] = object2} else obj2 = 999
if instance_exists(object3) {obj3 = sc_target(object3) c[sc_target(object3)] = object3} else obj3 = 999
if instance_exists(object4) {obj4 = sc_target(object4) c[sc_target(object4)] = object4} else obj4 = 999

if HP !=0 && !(obj0=999 && obj1=999 && obj2=999 && obj3=999 && obj4=999)
{
a = min(obj0,obj1,obj2,obj3,obj4)
move_towards_point(c[a].x,c[a].y,3)
}
else speed =0

itu ak buat move_toward target, jadi di hapus aja kode move_towards_point(c[a].x,c[a].y,3) dan else speed =0
dan taruh script ny di atas kode kamu (di step event)

lalu pada kode kamu, ganti target.x jadi c[a].x dan target.y jadi c[a].y

Good luck Very Happy


Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Tue 28 May 2013, 21:12

ERROR in
action number 1
of Step Event
for object ob_tower_laser:

Error in code at line 7:
if own_health !=0 && !(obj0=999 && obj1=999 && obj2=999 && obj3=999 && obj4=999)
^
at position 5: Unknown variable own_health

mas @Kevin Blaze Coolerz error ni variable own_health g dketahui itu variabel di object enemy 1 ku yg aq jadiin parent gmana ya mas solusinya makasi.... bantuin ya....


oya ini // Initialise all variables di enemy 1
// Init variables and motion
{
own_health = round(40+power(controller.wave,1.5)*10);
health_def = round(40+power(controller.wave,1.5)*10);
myspeed = 4;
path_start(pth_level1h,myspeed,0,1);
}
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by zebrakelabu Wed 29 May 2013, 13:09

untuk bisa mengakses own_health enemy 1, kamu bisa pakai nama objectnya.

tapi kalau itu parent maka kamu ga bisa langsung pakai objenemy1.own_health, karena itu akan berpengaruh di instance terakhir aja. kamu harus tahu instanceid yang bersangkutan, dan diakses dengan (instanceid).own_health.
zebrakelabu
zebrakelabu
Admin
Admin

100%
Jumlah posting : 933
Points : 960
Join date : 06.01.13
Lokasi : Jakarta

http://www.project25games.com

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Wed 29 May 2013, 18:28

ada beberapa masalah yg MUNGKIN bisa terjadi:

parent ob_tower_laser adalah object enemy1 kah?
*kalo iya >> apakah di ob_tower_laser ada event Create ? kalo iya >> tambah code event_inherited pada create event ob_tower_laser.

*kalo bukan >> di set dulu parent ny jadi object enemy1, trus kembali ke *

btw nama object gk boleh ada spasi, baca ini
hehehe

Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 29 May 2013, 18:48

mas @zebrakelabu n mas @Kevin Blaze Coolerz mw nanya ni fungsi parent itu apa ya....??

mas @Kevin Blaze Coolerz g mas ob_tower_laser aq jadiin parent bagi tower yg lainnya trus ob_enemy1 jg aq jadiin parent bagi enemy 2 3 4 5 yg lainnya...

mas @zebrakelabu uda aq ubah gameQ aq buatin ob_enemy_parent la kok malah error ini ya....?? barang kali mas bisa bantu sma mas @Kevin Blaze Coolerz...... hehehehehe....

ini erorrnya mas......


___________________________________________
ERROR in
action number 1
of Step Event
for object ob_tower_laser:

In script sc_target:
Error in code at line 1:
return argument0.own_health*distance_to_object(argument0)/argument0.speed ;
^
at position 69: Division by 0.
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Wed 29 May 2013, 19:13

wah pantes gk kedeteksi variable ny XD

ok, ak fix error yg baru aja.. coba ubah dikit kode di sc_target, jadi:
if argument0.speed != 0
return argument0.own_health*distance_to_object(argument0)/argument0.speed;
Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Wed 29 May 2013, 20:19

mas @Kevin Blaze Coolerz hehehehe... Laughing makasi mas uda bisa......
tapi kok ada g beresnya dikit ya...?? kadang musuh yang uda masuk dalam range tembak tapi kok g dtembak ya...?? malah dbiarin knp y mas....?? ni ssnya dbawah.... game tower defense 50837852
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by zebrakelabu Thu 30 May 2013, 06:13

bisa minta .gmk nya ngga? aku mumet kalo baca separuh2 gini. yang latest build ya. soalnya kamu bikin prefix cuman 2 huruf, ga pake bracketing yang konsisten Curiga

zebrakelabu
zebrakelabu
Admin
Admin

100%
Jumlah posting : 933
Points : 960
Join date : 06.01.13
Lokasi : Jakarta

http://www.project25games.com

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Kevin Blaze Coolerz Thu 30 May 2013, 15:16

solusi cepat ya kmu kirim file .gmk kmu ke admin Very Happy
gk akan di bajak kok Smile

Kevin Blaze Coolerz
Kevin Blaze Coolerz
Admin
Admin

100%
Jumlah posting : 3323
Points : 3795
Join date : 06.01.13
Age : 29
Lokasi : Palembang

http://kevin-blaze-coolerz.blogspot.com/

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by adamas galleh mulyawan Thu 30 May 2013, 15:40

hehehehehe..... oce mas...... iya mas coz aq juga niru punya athanatos mas....
soalnya ni tugas UAS pdhl aq g pernah pegang GM
cara ngirim keAdminnya gmana ya....??? Bingung hehehehehe..... Hammer
adamas galleh mulyawan
adamas galleh mulyawan
Newbie
Newbie

100%
Jumlah posting : 81
Points : 82
Join date : 07.05.13
Age : 27
Lokasi : sby

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Asuna Thu 30 May 2013, 15:48

@adamas
PM aja Hammer
Asuna
Asuna
Global Moderator
Global Moderator

100%
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13

Kembali Ke Atas Go down

game tower defense Empty Re: game tower defense

Post by Sponsored content


Sponsored content


Kembali Ke Atas Go down

Halaman 1 dari 4 1, 2, 3, 4  Next

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik