Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Calling other subs


peekay
 Share

Recommended Posts

Now im trying to call over subs into a scripted NPC sequence in attackNPC in EO.
When I try to call getplayerdir(index) it says that its not a defined variable
do I just dim index as long in the attackNPC sub?

thanks
- PK
Link to comment
Share on other sites

@peekay:

> What about say that ive created a scripted npc behaviour.
> And in the script for that npc I call
> cannpcmove
> can I make the dir set to the players dir
> or should I use the updatenpcAI for this

Depends on how you want to organize your source I guess. Just try a couple ways to see how it best fits whatever you're making. As for setting the NPC's direction to the same as the player's direction, that's really simple stuff. I'd wager you're trying to make some kind of NPC pet system or improve on the AI. It'll take a lot if you don't know how simple things like that are done.

```
Npc(map, slot).dir = player(index).dir
```
Just fill in map, slot, and index with the appropriate variables as whatever sub you decide to slap that in uses.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...