Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Creatething(template,GetLocalPlayerThing());
Creatething(template,GetLocalPlayerThing());
2001-11-25, 12:14 PM #1
I'm trying to create a thing at the PLAYER'S
position within a cog using this statement:

Creatething(template,GetLocalPlayerThing());

Doesn't work. I'm pulling my hair out.
All the other code in the block works, so it must be my syntax or something.

I notice that there are also a couple other variations of the Creatething verb. What's the difference?

I know I know. Why would I want to create a thing at the player's position right? Trust me.

Help
thanx
--==CWE_Darth_Opie==--
2001-11-25, 12:37 PM #2
Welp, the simplest this I could suggest is to predefine the player.


As in:
Code:
Player = Getplayerthing();
Creatething(Template, Player);



But other than that I have no idea.

Just go over your cog again, and see if youve mislabled anything.

And dont forget to check your installation of the cog, the problem might lie there.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 12:39 PM #3
As for your question about the diferent types - The only other major tye is 'Createthingatpos()', which allows you to create an objct at a vector location.

The rest are minute varations on those.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 5:45 PM #4
Hmmm still doesn't work. Blah. And I'm so close to having a cog that lets you drive a vehicle.

Here we go. I'm gonna scale it down to client/server later once its working.
I'll try to include the relavant stuff b/c
copying into this box doesn't work very well.
Lemme know if you would like to see the gob.

symbols
thing player local
thing vehicle linkid=1
thing weapon local
vector vehiclepos local
template atst
model vehicle3do
sector vehiclesector local
flex vehiclecog local
int oldweapon local
int oldhealth local
int atstflags local
int gun1 local
int gun2 local
int gun3 local
int gun4 local
int gun5 local
int gun6 local
int gun7 local
int gun8 local
int gun9 local
int gun10 local
int bacta local
int mana local
int prevweap local
message activated
message startup
message selected
end

# ========================================================================================

code

startup:
vehicletemplate=GetThingTemplate(vehicle);
vehiclecog=GetThingClassCog(vehicle);
vehiclepos=GetThingPos(vehicle);
vehiclesector=GetThingSector(vehicle);
return;

activated:
player = GetLocalPlayerThing();
if(GetSenderRef()==vehicle)
{
Print("You have entered an ATST!!");
DestroyThing(vehicle);
oldhealth = GetThingHealth(player);
oldweapon = GetCurWeapon(player);
SetInvActivated(player, 116, 1);
SelectWeapon(player, 1);
SetInvActivated(player, 119, 0);
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
SetThingHealth(player, 400);
ParseArg(player, "model3d=at.3do");
ParseArg(player, "maxhealth=400.00");
ParseArg(player, "health=400.00");
ParseArg(player, "puppet=atst.pup");
ParseArg(player, "soundclass=atst.snd");
ParseArg(player, "maxvel=0.400000");
ParseArg(player, "maxthrust=0.30");
ParseArg(player, "maxrotthrust=10.00");
//ParseArg(player, "jumpspeed=0.0");
//ParseArg(player, "eyeoffset=(0.300000/0.300000/0.000000)";
//ParseArg(player, "weapon=+lasercannon";
//ParseArg(player, "thingflags="0x4");
//Gun1 = GetInv(player, 1);
//Gun2 = GetInv(player, 2);
//Gun3 = GetInv(player, 3);
//Gun4 = GetInv(player, 4);
//Gun5 = GetInv(player, 5);
//Gun6 = GetInv(player, 6);
//Gun7 = GetInv(player, 7);
//Gun8 = GetInv(player, 8);
//Gun9 = GetInv(player, 9);
//Gun10 = GetInv(player, 10);
//bacta = GetInv(player, 40);
//mana = GetInv(player, 14);
//SetInv(player, 1, 0);
//SetInv(player, 2, 0);
//SetInv(player, 3, 0);
//SetInv(player, 4, 0);
//SetInv(player, 5, 0);
//SetInv(player, 6, 0);
//SetInv(player, 7, 0);
//SetInv(player, 8, 0);
//SetInv(player, 9, 0);
//SetInv(player, 10, 0);
SetInv(player, 40, 0);
SetInv(player, 14, 0);
//SetCurWeapon(player,0);
//SetThingFlags(vehicle,0x0);
}
else


if(IsInvActivated(player, 116) == 1)
{
ParseArg(player, "model3d=ky.3do");
ParseArg(player, "puppet=ky.pup");
ParseArg(player, "soundclass=ky.snd");
Print("Exiting Vehicle!");
ParseArg(player, "maxhealth=100.00");
ParseArg(player, "health=100.00");
ParseArg(player, "maxvel=0.400000");
ParseArg(player, "maxthrust=1.5");
ParseArg(player, "maxrotthrust=1.0");
ParseArg(player, "jumpspeed=2.0");
//SetInvActivated(player, 116, 0);
//SelectWeapon(player, oldweapon);
//SetThingHealth(player, oldhealth);
//Prevweap=GetCurWeapon(player);
//SetInv(player, 1, Gun1);
//SetInv(player, 2, Gun2);
//SetInv(player, 3, Gun3);
//SetInv(player, 4, Gun4);
//SetInv(player, 5, Gun5);
//SetInv(player, 6, Gun6);
//SetInv(player, 7, Gun7);
//SetInv(player, 8, Gun8);
//SetInv(player, 9, Gun9);
//SetInv(player, 10, Gun10);
//SetInv(player, 40, bacta);
//SetInv(player, 14, mana);
//SetCurWeapon(player,prevweap);
//SetThingFlags(vehicle,atstflags);
//SetThingClassCog(vehicle, vehiclecog);
CreateThing(atst,vehiclepos);
}
return;


selected:
return;

end

The long and short is. When you click on a thing it transforms your template into that thing. That part works. Turret Guns for this shouldn't be a problem. When I "get in" I destroy the ATST I activated, thus "becoming" the ATST. I can go reset the kyle template properties with the "Exit Vehicle" key i defined, that works. But for some reason right after that code I can't do a creatething of an atst at my player location.

I guess the question is can you create 2 things at the same position? If not, how would you go about getting past this.

I saw the bacta tank dispenser thing and thought I'd try that using a player
.(To try to put a bactatank at the players pos) But when I use player as the position it did nothing.


ARgghghghg. So close.

--==CWE_Darth_Opie==--

PS sorry i like to comment irrlevant stuff out that i've tried
2001-11-25, 6:03 PM #5
Your problem is simple - Your trying to use 'Creatething()' with a vertex, you cannot. 'Creatething()' creates a thing at the position of another thing, meaning you have to reference an object.

'Createthingatpos()' would allow you to use a vertex, but I think it would be better to use 'Creatething(Atst, Player)'.

Unless youve already tried that....

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 6:06 PM #6
BTW, if you want this to work multiple times, you might consider making it:

Code:
Vehicle = Creatething(Atst, Player);
Capturething(Vehicle);
Stop;


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 6:06 PM #7
I tried that, but I'll doublecheck.

OpIe
2001-11-25, 6:14 PM #8
You see what I'm getting at right? This is my test for the big tamale. The AT-AT.

Picture it.
You make an AI of an AT-AT thats walkable on the inside(So people can jump in). You reedit the current 3do. You make a snd file. You make Puppets for it(turning would be an issue [http://forums.massassi.net/html/smile.gif] ).

You then subtract the AI possibility and take all these things and apply them to a cog like this. Cool huh?

You just killed 2 birds with one stone. Drivable AT-AT. AT-AT for a synced AI in MP?

Hmm who's to say you couldn't do it with a....say....jeep?
2001-11-25, 6:40 PM #9
Ahh my player is still falling out of the sky when I hit the "Exit Vehicle" button.
This is a hard one huh?

what does capturething capture? tell me when a thing is created?

nicotine run! I'm running out of options

at least I fall overand die appropriately when Im in my ATST
2001-11-25, 6:57 PM #10
hmm what if it's because Im using destroyThing?
Still If you say vehicle=CreateThing(template,player);
it should reinitialize vehicle
2001-11-25, 6:58 PM #11
Hmm, didnt Hideki do somehtink like this in his Enhancement pack?

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 7:01 PM #12
No, what 'Vehicle = Creatething()' is doing is creating an object, and defining it emmedietly as 'Vehicle', 'Capturething()' redirects thing messages to that cog, so when you go to activate it again, that cog will recieve the message.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-25, 7:03 PM #13
i dunno never seen Hiedek's thing hafta look for it
2001-11-26, 1:08 PM #14
Dude, I ungobbed Heideks Enhancement Pack to see how he did it.(Wonderful mod!) It appears you can't do a creathing at the players position. Anywhere else is fine. Heidek uses vector addition and positioning to solve this problem. I'm gonna try to get in touch with him(Hiedek) and see if its ok to tweak his ATST and Kyle cogs to make a general client server version that has puppet, template, and sndfile options so you can attach it to any thing and specify what type of vehicle you start "driving". This being based on the premise that you create a nice AI template for the vehicle first to view the movements stuff. Thanks for all the kewl help. I'll keep you updated and start a drivable vehicle thread(If thats OK?).

--==CWE_Darth_Opie==--
2001-11-26, 1:46 PM #15
Just to make sure (everyone does it for the first time), my name is Hideki. Japanese names are hard for you I understand. (ok, I'm getting like w.matthias here [http://forums.massassi.net/html/smile.gif])

Anyways, I actually never encountered such problem not being able to create something at a certain position, probably I didn't meet such problem, so I didn't know such problem could occur in certain occasions.

And you can use my codes as you like.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited November 26, 2001).]
2001-11-26, 2:07 PM #16
oops my bad. It must be that "i before e" thing that's blurring my vision. Wasn't paying attention. Been busy today with my son. Just emailed you.

Hideki! Let's say it again.

"Yes, yes....this time...without the oops."
-Jeff G./ID4

Hideki!



------------------
--==CWE_Darth_Opie==--
Whatever happened to the good 'ole days of Manowars and Empire Nightclub? :)
2001-11-26, 5:57 PM #17
Don't feel bad editormg, i've known Hideki for quite a while and I still get his name wrong :P ( I have to copy and paste Hideki's name all the time, to get it right ) [http://forums.massassi.net/html/smile.gif]
2001-11-26, 6:19 PM #18
Hideki

is that pronounced "Hee-dee-ki", "Hi-dee-kee, or "Hi-dee-ki"?
no offense just wanna get it right.

kinda like if someone called me "bubba" just cause I live in South Carolina

"Know what I mean...Vern?"

------------------
--==CWE_Darth_Opie==--
Whatever happened to the good 'ole days of Manowars and Empire Nightclub? :)
2001-11-27, 11:17 AM #19
I pronounce it "high-deck-eee", but then again, I really don't say it outloud too much [http://forums.massassi.net/html/wink.gif]
2001-11-27, 11:12 PM #20
"Hi" is pronounced as in "hill"
"de" is as in "dell"
"ki" is as in "kill".

So it's not like the word "hide" is in front of "ki". I remember people calling me "haideck" or "haidekee" and in all sorts of funny way back in Australia days. [http://forums.massassi.net/html/smile.gif]

Now you guys not only can write but say my name in the right way!

This is my actual Japanese first name, and is quite common in Japan. Quite handy to use as a handle name on the net as not many people uses it [http://forums.massassi.net/html/smile.gif]

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited November 28, 2001).]

↑ Up to the top!