# Help with rpg game

**URL:** <https://forum.kirupa.com/t/help-with-rpg-game/65038>\
**Category:** programming\
**Created:** [September 22, 2004, 1:51pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038 "2004-09-22T13:51:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Odin13](https://avatars.discourse-cdn.com/v4/letter/o/6a8cbe/32.png) [@Odin13](https://forum.kirupa.com/u/Odin13)\
**Post date:** [September 22, 2004, 1:51pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/1 "2004-09-22T13:51:31Z")

</div>

well I want to make a game in flash and I got codes for movement and hittest with buildings and stuff.  
I have some problems with other scripts I need to figure out.  
the game soppused to be scripted like zelda basiclly( character moves around, talk to people and attack with a sword)  
but I want it to be with gta-style gameplay ( when you talk to people they give you missions).  
I asked some forums on how to do that stuff but they keep ignoring or just post stupid replys…  
so if you want to help me, here is what I need you to help me with:

- attacking- shooting , sword or melee
- scrolling (smooth scrolling or screen transitions)
- inventory(with getting and giving items on inventory)
- process of talking someone (how to use triggers?)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 22, 2004, 2:05pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/2 "2004-09-22T14:05:30Z")

</div>

Well talking is simple just make dynamic textbox with the var name message on a movie clip labeled talk.Then the code

onClipEvent (load) {  
timer = false;//timer is off  
c=0;

}  
onClipEvent (enterFrame) {  
\_root.f = c;  
if (this.hitTest(\_root.hero)) {

```
	_root.talk._visible=1;
	_root.talk.message = "Hi.";
	c = 0;
	timer = true;
}
if (timer == true) {//start timer
	c++;
}
if (c&gt;=5) {//timer clicks 50 times
	_root.talk._visible=0;
	c = 0;
	timer = false;
}

```

}

Then just label your character hero.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 22, 2004, 3:47pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/3 "2004-09-22T15:47:55Z")

</div>

> [@Odin13](#):
>
> well I want to make a game in flash and I got codes for movement and hittest with buildings and stuff.  
> I have some problems with other scripts I need to figure out.  
> the game soppused to be scripted like zelda basiclly( character moves around, talk to people and attack with a sword)  
> but I want it to be with gta-style gameplay ( when you talk to people they give you missions).  
> I asked some forums on how to do that stuff but they keep ignoring or just post stupid replys…  
> so if you want to help me, here is what I need you to help me with:
> 
> - attacking- shooting , sword or melee
> - scrolling (smooth scrolling or screen transitions)
> - inventory(with getting and giving items on inventory)
> - process of talking someone (how to use triggers?)

Maybe you should try this thread:

[http://www.kirupaforum.com/forums/showthread.php?t=54066&page=1](http://www.kirupaforum.com/forums/showthread.php?t=54066&page=1)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 1:59pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/4 "2004-09-23T13:59:51Z")

</div>

thnx, but how can I make my character attack (with animation changing)?  
I know It’s something like  
"if (Key.isDown(Key.SPACE)) {"…gotoandplay…  
but I don’t know how to do the hittest stuff with stuff like sword attack or gun shot…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 4:44pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/5 "2004-09-23T16:44:47Z")

</div>

It’s this:

```php

if (Key.isDown(Key.SPACE)) {
	hero.gotoAndStop("slash_animation");
	hero.slash_animation.play(1);
	}
}

```

as for the sword hitting, inside of 'is animation, make the sword into a movieClip and give it an instance name of “sword”. Then program the heros actions to say:

```php

if (hero.slash_sequence.sword.hitTest(badGuy)) {
	badGuy.gotoAndStop("die_animation");
	}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 4:52pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/6 "2004-09-23T16:52:35Z")

</div>

Hey! I was going to help!

peace

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:02pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/7 "2004-09-23T17:02:20Z")

</div>

thanx all of you!  
I really appreciate this!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:43pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/8 "2004-09-23T17:43:42Z")

</div>

I have some problems with the animation code…  
can you give me some detail on how to do it right?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 9:04pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/9 "2004-09-23T21:04:28Z")

</div>

Well, here is something to help you:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 24, 2004, 9:49am UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/10 "2004-09-24T09:49:56Z")

</div>

how can I get him to stop attacking?  
I want him to attack once in every key press, and not continue to attack without stopping…  
I tried to put “stop()”, write “gotoandstop” but it just made that worse.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 4:45pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/11 "2004-09-27T16:45:13Z")

</div>

well in your sword or punch MC at end just type

punching=false  
gotoAndStop(1);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 10:47pm UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/12 "2004-09-27T22:47:02Z")

</div>

> [@leoHEK](#):
>
> well in your sword or punch MC at end just type
> 
> punching=false  
> gotoAndStop(1);

Yeah, then in an onClipEvent(keyUp), type punching = true;.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 28, 2004, 9:34am UTC](https://forum.kirupa.com/t/help-with-rpg-game/65038/13 "2004-09-28T09:34:29Z")

</div>

joMan - hehe, I like your punch fla. Nice simple animation :¬)
