Spawnable global object

Help regarding development/scripting, troubleshooting or just general gameplay -- anything that hasn't already been answered in the Wiki or pinned FAQs.

Moderator: Developers

Post Reply
Dark
Tranch (Novice)
Tranch (Novice)
Posts: 148
Joined: Mon Mar 30, 2009 4:05 pm

Spawnable global object

Post by Dark »

Im still working on my gnomish steam walkers and it seems this time I stumbled on a pretty tough problem.
I wanted to try making a toolkit item that when used spawns a walker.
As far as I searched around and understood theres no easy solution to this.

Heres how I get it. If Im wrong about something please correct me.

"SpawnCharacterXYZ" function creates a new character as the same type as script user. That is it kinda copies the object.
Its how most global items work. The held "item" version and placed "game object" version are both the same thing but in different states.
I have different 3D model for item and the walker though and its kinda tough to mix them together. Havent seen any way to change objects model during game.

Spells seem to be some kind of special case as they got the "book" version and "spell" version which are switched between one another.
I wouldnt wish my toolkit to be a book though. I was thinking more like a large box. Besides I still dont full get how these work exactly.

Character can be spawned with the "SpawnExactCharacterXYZ" function but it takes as argument slot number which is listed in spawn.txt file of every module.
Therefore this function wont do unless every single module in Egoboo adds the walkers into their spawn.txt.

I also found some odd note... "Slot is the character's profile slot... Get this from checking SLOT.TXT or DATA.TXT."
I havent seen a file called "slot.txt" anywhere.

Can someone give me any direction in this? Is what Im trying to do possible?


Edit: Ok. I just managed to do it by adding a slotted dependency in spawn.txt of a module.
It would still require to add this line everywhere though.
Are there any alternatives?
Image
User avatar
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Re: Spawnable global object

Post by penguinflyer5234 »

Instead of a number, could you try a string with the object name inside? ("gelfeet.obj" for example)

I can't remember if Zefz added that or not :(
...
Dark
Tranch (Novice)
Tranch (Novice)
Posts: 148
Joined: Mon Mar 30, 2009 4:05 pm

Re: Spawnable global object

Post by Dark »

You mean as an argument to the "SpawnExactCharacterXYZ"?
I havent seen a string ever user as function argument.
Tried it though and didnt seem to work. (Though Im not even sure how to mark the string. Any quote marks etc?)

I guess I should mention that I got the release 2.8.1 version.
Image
User avatar
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Re: Spawnable global object

Post by penguinflyer5234 »

tmpargument = "gelfeet.obj"
tmpx = blah
SpawnExactCharacterXYZ (I don't remember what the difference is between SpawnExact and Spawn :|)

It was a "recent" thing, adding strings for like SendMessageNear and the like. It could've been a wanted feature though
...
Dark
Tranch (Novice)
Tranch (Novice)
Posts: 148
Joined: Mon Mar 30, 2009 4:05 pm

Re: Spawnable global object

Post by Dark »

Its not working in my version but if its planned as youre saying then thats exactly what I need.
Guess Ill wait with finishing this for the next release.
Thanks for help!
Image
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: Spawnable global object

Post by Zefz »

penguinflyer5234 wrote:Instead of a number, could you try a string with the object name inside? ("gelfeet.obj" for example)

I can't remember if Zefz added that or not :(
Yes, I had implemented this in the trunk. I don't remember if this is in the RC or not.
Post Reply