Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Dungeon Keeper Possesion spell

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Nov 2005 12:03 Edited at: 18th Nov 2005 12:23
Hello anyone played dungeon keeper here? I want to know how I can possess an NPC or AI charector and get control of their body then unpossess them. I think it is is similiar to getting in and out of vehicles but without the key but I am not sure how to do either, can I get an example of how to do either please?
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 18th Nov 2005 23:41
Well, I'm sure you have a 'position object blah'... just replace that number with the other object
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 22nd Nov 2005 12:47 Edited at: 22nd Nov 2005 12:54
I see, you mean place object1 in exactly the same place as object 2?
but then that still leaves how to control object 2 and keep object1 hidden and going along with object1.

That is ok A.I but for player avatar's how would that work?
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 19th Mar 2006 08:26 Edited at: 19th Mar 2006 15:50
Would I need the variable _inperson?
optical r
22
Years of Service
User Offline
Joined: 23rd Oct 2002
Location: Prime
Posted: 19th Mar 2006 11:08 Edited at: 19th Mar 2006 11:09
@ vampyre

Right, you would setup a variable for your character and NPC, say




Set up few general, global declarations (variables later used)



After that you would need to define some attributes for your character and NPC(trust me), using a type



Now delcare a variable for each the player and the NPC to assign the above Attributes to (effectively creating a small database for each character)



This has assigned the Attributes to all of '5' players (I know you only need 2 for this example but this shows how you can expand through optimisation)

Now, obviously, you need to create the avatar (rotten cubes for now )



A simple process. Don't worry about the 'FreeObject()' for now, ill explain later

Ok so now you have 5 cube seemingly independant from each other on your screen in random positions!

Now onto the 'possesion part'

Add simple controls to out Main player (MyChar)



So, now we need to create the movement part of the code in the form of 'Move_Object(Object)' function



Basically this code moves the appropriate player based on what state the main player is in. Its only simple so the basics should work, you coul always expand on it

Now about the 'FreeObject()' function. This is a great little function that finds a free object number in the system. You should always assign a varaible name to the free object found for manipulation. Its more object orientated than anythign else.



The function return the object number 'i' to where the function was invked (in this case into the variable Avatar(i).ID' effectively creating MaxPlayer Amount (10) free objects. PUT THIS AFTER MAIN LOOP

Hope that helps. I wrote entierely in the annoying little message windown and havn'et complied it. If it doesnt work email or tell me here and i'' check back soon.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 19th Mar 2006 12:59 Edited at: 19th Mar 2006 13:13
OK thanks optical r this also means using Dbp then if I am to use types fortunately I got DBP
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 26th Mar 2006 04:34 Edited at: 26th Mar 2006 04:36
optical r I tried this program out both in DBC and dbp IN dbc It doesn't recognise the command Global and in DBP it says variable Avatar at line 40 doesn't exisit what is wrong here exactly? this how I got the code compiled
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 27th Mar 2006 00:33 Edited at: 27th Mar 2006 00:34
Does anyone know where I went wrong? Please help

Login to post a reply

Server time is: 2025-05-23 19:03:52
Your offset time is: 2025-05-23 19:03:52