Forum_account

Joined: Dec 2 2009

Shoutbox

D-Cire
6:16 pm
Get step was basically checking if its in front of the user before attacking, you dont want to attack someone behind you. Lol. Im unsure exactly what bounds_dist does, i figured it just checked if it was in 32 pixels of you it would come up true.
Forum_account
Monday, 12:52 pm
My first guess is the "else if(src.Target in get_step(src,src.dir))" line. I'm actually not sure what that part is for - if you've reached that point you know that the bounds_dist to the target is >= 32. That else if and the else at the end might not even be necessary.
D-Cire
Monday, 12:38 pm
that works for the most part, but upon running north/south then east/west it spazzes again.
Forum_account
Monday, 7:30 am
My initial guess was the first line that says "src.Target=null". You're clearing the mob's target when they get close to their target. I'd think you'd want to switch to some different behavior here (ex: attacking) but keep the target set.

It appears to work for me but I had to make some adjustments to get it working. I put this code in the mob's action() proc:

mob
enemy
action()
..()

if(src.Target)
if(bounds_dist(src, src.Target) < 32 && !move_towards(src.Target))
src.Target = null
stop()
slow_down()
return

src.dir = get_dir(src, src.Target)

if(get_dist(src.Target, src) > 8)
src.Target = null

else if(src.Target in get_step(src,src.dir))
// sleep(5)
stop()
slow_down()
else
move_towards(src.Target)

if(!src.Target)
for(var/mob/M in oview(8, src))
if(M.key)
src.Target = M
// sleep(10)
break
D-Cire
Feb 17, 7:24 pm
while(src)
if(src.Target)
if(bounds_dist(src,src.Target) < 32 && !move_towards(src.Target))
src.Target=null
stop()
slow_down()
continue
src.dir=get_dir(src,src.Target)
//src.Fight()
if(!ListCheck(src.Target,oview(8)))
src.Target=null
else if(src.Target in get_step(src,src.dir))
sleep(5)
stop()
slow_down()
else
move_towards(src.Target)
if(!src.Target)
for(var/mob/M in oview(8))
if(M.key)
src.Target=M
sleep(10)
break


"Spazzes out" As in doesn't look at the direction of the Target and instead flickers around in the 4 base directions while moving towards the target. Does the same thing while next to the target.

[See all] [Login to shout]

Subject
Replies
Date
Location
 
Create variables to store the separate components of the world's icon size. For example: world icon_size = "18x24" mob …
2
 
I've been working on creating HTML pages for each of my libraries that describe what the library does, describe each …
4
I posted an update earlier today. The big changes are: The library now uses the Keyboard library for input. Many vars …
4
 
This article explains why DM libraries can greatly benefit the community. It's not just meant to convince people to use …
Page: 1 2 3 4 5
80
Automatically generates edge icons for turfs and places them on the map.
6
I just posted an overdue update. I used to update the library once or twice a month but it's been just over two months …
5
An easy way to create tiles that warp mobs to another location.
8
An easier way to manage BYOND's hub-based features.
1
Hub
An easy way to create speech bubbles on the map.
3
6
An easy way to manage and manipulate overlays.
2
 
When you search the forums, you don't get a complete set of results. For example, if you search the Demos & Libraries …
11
Not a HUD library, a Hub library.
11
Hub
 
I'm working on a new library that'll make some of BYOND's existing hub-based features easier to use. It's not ready to …
6
8
 
The reference page for world.GetMedal says: "If the world already knows this medal was earned before, the hub will not …
1
 
I've set many deadlines for myself and have missed them all. While it doesn't look like I'll meet the self-imposed …
Page: 1 2 3
48
 
I've been working on translating my idea for a strictly video-based tutorial into a more traditional written tutorial …
18
I just posted another update that adds another demo called "inventory-demo". This demo shows how to create a basic …
5
 
Here's my first attempt at a game development video tutorial. My plan was to record all of the steps that go into …
18
 
Have BYOND provide a chat server that would be used to replace the pager and could be leveraged by game developers …
3
 
Information about library updates and an offer to all of BYOND's pixel artists.
9
A new library for handling keyboard input.
5
A library for handling keyboard input.
0
 
Some observations and questions about the BYOND staff's lack of development activity and interest towards BYOND.
Page: 1 2 3 4
70
 
I saw this in the reference today: The datum object is the ancestor of all other data types in DM. (The only exceptions …
1
A fairly significant update to the Pixel Movement library.
4
Added an on-screen message log demo and on-screen interface controls.
8
 
An explanation of why developers lose motivation and can't finish games.
12
Added two new demos and make some changes to my HUD Groups library.
18
A new library for creating and managing screen objects.
Page: 1 2
37
 
Some rules you might want to use when naming variables.
6
An easy way to manage screen objects.
7
A *big* update to the Sidescroller library!
11
 
This is based on this forum post. It sounds like a lot of graphical display problems and limitations come from using …
Page: 1 2 3
49
Before BYOND had native support for pixel movement, the Pixel Movement library had its own pixel movement …
5
 
A preview of some promising updates for the Pixel Movement and Sidescroller libraries.
10
 
Some tips about how you can design objects to make the map editor easier to use.
11
 
There are many different ways to use loops to do the same thing, but certain methods are clearer.
12
 
Some tips about how to use comments and whitespace effectively to improve your code.
8
 
Tips about how to split code into procs to make game development easier on yourself.
Page: 1 2
23
 
Some tips about how to keep code organized - how to name vars/procs, how to split code between files, and more!
8
 
How to use datums effectively to keep your code simple and well-organized.
15
 
More useful tips about game development to prevent your projects from being more complicated than they need to be.
10
 
Some useful tips about programming and game development, specifically about how to avoid getting stuck in the design …
16
 
Some useful tips to help keep your code organized by simplifying if statements.
Page: 1 2
32
 
The BYOND blog used to be somewhat active. The staff (well, Tom at least) started off this year strong, posting on Jan …
8
A new demo and an update to the sidescroller library.
9
A sample top-down shooter.
17
 
What's the criteria for a featured developer resources? It seems quite arbitrary. These things are featured …
4
Page: 1 2 3 4