In response to Rii
The problem here is that things like if() can't be used directly under the obj/top_half definition...

It'll have to go into a proc...

What you can do is put all of that if() checking into New(), and give New() an argument of mob/M...

obj
top_half
New(mob/M)
if(istype(M,/mob/player/fighter))
icon = 'fighter.dmi'
//blah, blah, etc, etc
if(istype(M,/mob/player/knight))
//blah, blah, etc, etc

And so on...

Then, when you add the overlay, do it like this:

src.overlays += new/obj/top_half(src)

(this line will have to go after the player has chosen a player type, and is logged into that type of mob)

What this will do is take the player (src), and pass them into the top_half's New(mob/M) proc via the mob/M argument... M will be equal to the player, so it'll go through, and check M's type, and change the object's icon, icon_state, etc accordingly...
In response to SuperSaiyanGokuX
I have changed all the things as you have said and no errors have appeared, only problem is the head still doesnt appear when you have been located into the castle
In response to Rii
This might have something to do with the fact that the first argument to New() is always Loc... try this:

<code>obj top_half New(Loc,mob/M) if(istype(M,/mob/player/fighter)) icon = 'fighter.dmi' //blah, blah, etc, etc if(istype(M,/mob/player/knight)) //blah, blah, etc, etc</code>

And:

<code>src.overlays += new/obj/top_half(null,src)</code>
In response to Crispy
I don't think that's right, actually... That thought crossed my mind when I was typing that code, so I performed a test...

I passed a single argument through New(), and it wasn't the location... And it worked fine... It was the following code:

mob
Login()
src.client.screen += new /obj/HUDobject(src)

obj
HUDobject
New(mob/M)
M << "Hello, there!"

And it came out just fine... So it must work this way (unless I stumbled upon some fluke...lol)...

My guess is that he has a problem in the naming of the icon_state for the head icon, or that he didn't change the icon_state in the teleporting code...
In response to SuperSaiyanGokuX
Actually, that first argument is still the location. What that's actually doing, if I'm not mistaken, is creating the HUD object in the mob's contents. It still works, but it's not entirely doing what it appears to be doing. =)
In response to Crispy
Ahhh, good point... Well, in that case, the code I gave him should be doing the same thing...so it still can't be what's causing the trouble...

It might not be the best way to do things, but it must work that way...lol
In response to SuperSaiyanGokuX
castle_entrance1
left
icon = 'buildings.dmi'
icon_state = "left_entrance"
Entered()
src.overlays += new/obj/top_half(null,src)
src.icon_state = "body"
usr.loc=locate(17,1,1)
src << sound("chronoguardiacastle2.mid",1)

Is there a problem in there that I cant see?
In response to Rii
Rii wrote:
castle_entrance1
left
icon = 'buildings.dmi'
icon_state = "left_entrance"
Entered()
src.overlays += new/obj/top_half(null,src)
src.icon_state = "body"
usr.loc=locate(17,1,1)
src << sound("chronoguardiacastle2.mid",1)

Is there a problem in there that I cant see?

Yup, sure is... The problem is that in Entered(), src is the turf, not the player... So what this code is doing is adding the overlay to the turf, and changing the turf's icon_state, and playing a sound for the turf...lol It works to warp the player, because you're using usr in that line, and usr usually is the mob that walked into the turf...

However, using usr in Entered() is not the way to go (as Lummox will grunt at you in his caveman voice if he sees this...lol)...

Entered() is set up to accept an argument of the thing that walked into it... In this case, Entered(mob/M) will work... M will be set to the mob that entered the turf...

For the rest of the code, replace src and usr with M... Like: M.overlays += new/obj/top_half(null,M) and so on...

Then it should work just fine...
In response to SuperSaiyanGokuX
Well the multi tiling works now but the players head appears as its body icon_state =/ Anything that may be causing this?
In response to Rii
I can't tell you for sure what's doing it, but I'll go over how it has to be done once again:

The bottom half has to be one icon, and the top half has to be another icon... (different .dmi files, not just different icon_states)

Then, each icon has to have its corresponding icon_states named the same...

The bottom icon has to have an icon_state that shows just the regular player's small icon... Name it "normal" (or whatever you want, I'm just using that as an example) It also has to have a second icon_state, for the big view of the legs... Name that "townview" (again, or whatever)

The icon for the top half has to have two icon_states as well... One that's just a blank icon_state, named "normal" (or whatever you named the regular small icon_state in the first icon... it has to be named the same) And the second icon_state in this file has to be the top half of the big version... Name that one "townview" (or whatever you named the legs in the first icon)

And then, it will work...
In response to SuperSaiyanGokuX
Sorry I havent replied for a while, I was in Spain. How would I manage to set 2 icons for different characters then? Would I create them like fighter_head.dmi and fighter_body.dmi etc. ?

In response to Rii

In response to Rii
Yup... Just make two different icons, one for the bottom, and one for the top...

The bottom icon is the icon you give to the player... The top icon you assign to the overlay object...
In response to SuperSaiyanGokuX
Hmmmmm, =P Easy as pie then!
In response to Rii
3.1415926535897932384626433832795028841971693993751058209749
445923078164062862089986280348253421170679821480865132823066
470938446095505822317253594081284811174502841027019385211055
596446229489549303819644288109756659334461284756482337867831
652712019091456485669234603486104543266482133936072602491412
737245870066063155881748815209209628292540917153643678925903
600113305305488204665213841469519415116094330572703657595919
530921861173819326117931051185480744623799627495673518857527
248912279381830119491298336733624406566430860213949463952247
371907021798609437027705392171762931767523846748184676694051
320005681271452635608277857713427577896091736371787214684409
012249534301465495853710507922796892589235420199561121290219
608640344181598136297747713099605187072113499999983729780499
510597317328160963185950244594553469083026425223082533446850
352619311881710100031378387528865875332083814206171776691473
035982534904287554687311595628638823537875937519577818577805
321712268066130019278766111959092164201989...
Oh, pie with an e? My bad then!
In response to Garthor
You crazy mathematician, you.
Page: 1 2 3