Controling NPCs with different cursor commands...

Started by Raggit, Fri 23/05/2003 02:20:12

Previous topic - Next topic

Raggit

I could probably do this on my own but It'd take awhile to figure out!

Anyway, I want the player to be able to move some NPCs around by clicking a custom cursor on him, and then using the walk cursor where he wants him to go.

So here is how it should work:

The player uses the "select this character" cursor on the NPC and then clicks the walk icon on any walkable area and the NPC will go there.

Any way this can work easily?
--- BARACK OBAMA '08 ---
www.barackobama.com

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Jimi


Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Scorpiorus

QuoteThe player uses the "select this character" cursor on the NPC and then clicks the walk icon on any walkable area and the NPC will go there.
And how you suppose to return the walk mode to normal state when it is applied to the player character?

am

To return to normal character after clicking once with walk-to you could put in the "on click"
if cursorMode=walk && charid=??
moveCharacterBlocking(....)
setPlayerCharacter(?)
....

(you should probably also disable and enable things like inventory, use and etc.)

Scorpiorus

Yep, just wondering if he would like to return to normal state immediately after NPC has done his moving or maybe an option? :P

-Cheers

Raggit

#7
No, I want the player to be able to control all actions of the NPC, wich becomes the player character when selected, including the inventory and stuff.  The selection icon is a standard function.
All the player has to do is select it and click it on the NPC he wants.  Then he just clicks the walk icon and so on.

I can't reveal exactly what I'm doing until I'm sure it will all work out.

--- BARACK OBAMA '08 ---
www.barackobama.com

Scorpiorus

#8
ok, then just do what TK said:
Quote from: TK on Fri 23/05/2003 13:02:57
SetPlayerCharacter(CHARID);

You can use unhandled_event (int what, int type) to achieve what you want:

function unhandled_event (int what, int type) {
 if (what == 3 && type == 6) {
         SetPlayerCharacter(GetCharacterAt (mouse.x, mouse.y));
 }
}

Now whenever you click on a character with USERMODE1 cursor mode you get switched to that one.

SMF spam blocked by CleanTalk