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 → 6th or 7th sense...
12
6th or 7th sense...
2001-02-26, 3:54 AM #1
Anybody play the MotS level where Mara says, "I sense several beings near by."? Well, it gave me an idea. I came up with F_Sense. It's not very good yet, and I haven't tested it yet, because of the need for further developement. Currently all it will be once I finish the projectile is a probe. You have to actually make the projectile make contact. Anyway to make a projectile go through walls, and make those cones like in F-push, throw, grip, blinding, pull, and heal other? If there's any interest, I'll post my work so far, and hope I can get some help.
2001-02-26, 4:06 AM #2
There is a tutorial on the Targeting Reticule (the 'cones') here.

------------------
Together we stand.
Divided we fall.
2001-02-26, 4:12 AM #3
how would you do it through walls? and is there some sort of color guide?


[This message has been edited by Jedi Howell (edited February 26, 2001).]
2001-02-26, 2:39 PM #4
Not 100% sure here, but in order to retrieve something that is not visible to the player is to remove "if(HasLOS)", so even the player has no Line Of Sight, it should work, in your pulse message of the reticle part.

------------------
http://millennium.massassi.net/ - Millennium
2001-02-26, 2:45 PM #5
Thanks!

*Thinks: OK, now for the other 500 problems*

If it does work(which I am about to try), will the player still see the cone?

Thanks again
jh
2001-02-26, 3:21 PM #6
Well, I got it to print nothing up to the weapons statements. I think I might be using the GetActorWeapon function wrong. Would it return a 1 if the actor has it and a 0 if it didn't? or would it return a -1 if the actor didn't and a 0 if it did?

Thanks
jh

[edit]I tried it. I don't think it works that way, but I'm not sure. Is there a wait function?

thanx again
jh


[This message has been edited by Jedi Howell (edited February 26, 2001).]
2001-02-26, 3:38 PM #7
How about posting the codes?

------------------
http://millennium.massassi.net/ - Millennium
2001-02-26, 10:52 PM #8
Here it is:
Code:
# MotS Cog Script
#
# force_pull.COG //replaces f_pull, going to # fix that eventually
#
# 
# 
# 
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols
thing player
int potential
int vichealth
int vicmana
int vicweap1
int vicweap2
int vicweap3
int vicweap4
int vicweap5
int vicweap6
int vicweap7
int vicweap8
int vicweap9
int vicweap0
int vicmodel
int cost=5

flex mana
message activated
message pulse
message deactivated
end

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

code
startup:

//Let's set all this stuff
potential = GetSenderRef();
vichealth = GetHealth(victim);//this is the victim's health
vicmana = GetInv(victim, 14);//this is the victim's mana
vicweap1 = GetActorWeapon(potential, 1);//does the vic have fists out?
vicweap2 = GetActorWeapon(potential, 2);//does the vic have a bryar
vicweap3 = GetActorWeapon(potential, 3);//does the vic have an str
vicweap4 = GetActorWeapon(potential, 4);//does the vic have td's
vicweap5 = GetActorWeapon(potential, 5);//does the vic have a bc
vicweap6 = GetActorWeapon(potential, 6);//does the vic have a repeater
vicweap7 = GetActorWeapon(potential, 7);//does the vic have a rail detonator
vicweap8 = GetActorWeapon(potential, 8);//does the vic have seq. charges
vicweap9 = GetActorWeapon(potential, 9);//does the vic have a conc rifle
vicweap0 = GetActorWeapon(potential, 10);//does the vic have a saber
vicmodel = GetThingModel(victim);//what's the vics 3do

Return;
#........................................................................
activated:
SetPulse(0.33);
Return;
#........................................................................
pulse:
//now lets find a victim without an LOS
   potential = FirstThingInView(player, 20 + 15 * rank, 5.5, 0x424);
   while(potential != -1)
   {
      if(potential != player && potential == actor)
	{
	//now lets target a victim
JkSetTargetColor(12,13,14);
JkSetTarget(potential);
	}
    }

#........................................................................
deactivated:
JkEndTarget();

//and tell the player how that victim is doing
Print("The probe results:");

//The model of the probed victim
Print("Model:");
PrintInt(vicmodel);

//The health of the probed victim
Print("Health:");
PrintInt(vichealth);

//The mana of the probed victim
Print("Mana:");
PrintInt(vicmana);


//weapon time


Print("Weapon:");

if(vicweap1 == 0)
{
Print("Fists");
}
if(vicweap2 == 0)
{
Print("Bryar");
}
if(vicweap3 == 0)
{
Print("Stormtrooper Rifle");
}
if(vicweap4 == 0)
{
Print("Thermal Detonators");
}
if(vicweap5 == 0)
{
Print("Bowcaster");
}
if(vicweap6 == 0)
{
Print("Repeater");
}
if(vicweap7 == 0)
{
Print("Rail Detonator");
}
if(vicweap8 == 0)
{
Print("Sequencer Charges");
}
if(vicweap9 == 0)
{
Print("Concussion Rifle");
}
if(vicweap10 == 0)
{
Print("Lightsaber");
}
Return;
# ........................................................................................

end


I know that there's something wrong with the GetActorWeapon function, and the SetPulse function. I'm going to try to fix the SetPulse one today, but I don't know what GetActorWeapon will return if true and if false.

I also know that there's something wrong with the "potential=FirstThingInSight" stuff. Is there a suitable replacement for that for the see-through-walls ability?

jh

[This message has been edited by Jedi Howell (edited February 27, 2001).]

[Hideki - Use code tags]

[This message has been edited by Hideki (edited March 01, 2001).]
2001-02-28, 7:24 AM #9
The one above is an old one. I've made several changes since then, which I hope will make it better once the thing works. Unfortunatly, I still cannot get it to go past the Print("Weapon:") command. Plus I can't target anything. Because of the fact that this new one isn't any better than the above, I am going to leave that one there.

jh
2001-02-28, 8:11 AM #10
Okay, first off you shouldn't get the info on the victim in the startup message. The startup message only gets run once, when the level starts up. Try moving it to the deactivated message.

Next, it probably isn't targetting anything for a couple reasons. First, rank isn't defined. Either define a rank varible and set it to 1-4, or take it out of your FirstThingInView() line. Second, "potential == actor" won't work. You need to use GetThingType() and see if the actor or player flags are set (don't remember what they are).

Also, you need to make a victim variable and set it where you use JkSetTarget().

One more thing, you should use victim instead of potential on your GetActorWeapon() lines.

I hope this helps, your idea sounds pretty cool.


------------------
Can Linux Replace Windows?
2001-03-01, 2:21 AM #11
OK, here's my new one:
Code:
# Jedi Knight Cog Script
#
# force_sense.COG
#
# 
# 
# 
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols
int player
int potential
int victim
int vichealth
int vicmana
int vicweap1
int vicweap2
int vicweap3
int vicweap4
int vicweap5
int vicweap6
int vicweap7
int vicweap8
int vicweap9
int vicweap0
int vicmodel
int cost=5

flex mana
message activated
message pulse
message deactivated
end

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

code
startup:

//Let's set all this stuff
player = GetLocalPlayerThing();
vichealth = GetHealth(victim);//this is the victim's health
vicmana = GetInv(victim, 14);//this is the victim's mana
vicweap1 = GetActorWeapon(victim, 1);//does the vic have fists out?
vicweap2 = GetActorWeapon(victim, 2);//does the vic have a bryar
vicweap3 = GetActorWeapon(victim, 3);//does the vic have an str
vicweap4 = GetActorWeapon(victim, 4);//does the vic have tds
vicweap5 = GetActorWeapon(victim, 5);//does the vic have a bc
vicweap6 = GetActorWeapon(victim, 6);//does the vic have a repeater
vicweap7 = GetActorWeapon(victim, 7);//does the vic have a rail detonator
vicweap8 = GetActorWeapon(victim, 8);//does the vic have seq. charges
vicweap9 = GetActorWeapon(victim, 9);//does the vic have a conc rifle
vicweap0 = GetActorWeapon(victim, 10);//does the vic have a saber
vicmodel = GetThingModel(victim);//what's the vics 3do

Return;
#........................................................................
activated:
call pulse;
Return;
#........................................................................
pulse:
//now lets attempt to find a victim without an LOS[edit]let's keep the LOS until we can get this
//thing to do otherwise
potential = FirstThingInView(player,180,20 * 2,0x2);
if(HasLOS(player,potential))
{
	if (GetThingType(potential) == 4 || GetThingType(potential) == 10)
{
   while(potential != -1)
   {
      if(potential != player)
	{
	//now lets target a victim
victim = potential;
JkSetTargetColor(12,13,14);
JkSetTarget(victim);
	}
    }
}
}

#........................................................................
deselected:
//kill the cone!!!!
JkEndTarget();

//and tell the player how that victim is doing
Print("The probe results:");

//The model of the probed victim
Print("Model:");
PrintInt(vicmodel);

//The health of the probed victim
Print("Health:");
PrintInt(vichealth);

//The mana of the probed victim
Print("Mana:");
PrintInt(vicmana);


//weapon time
//*groans*


Print("Weapon:");

if(vicweap1 == 1)
{
Print("Fists");
}
if(vicweap2 == 1)
{
Print("Bryar");
}
if(vicweap3 == 1)
{
Print("Stormtrooper Rifle");
}
if(vicweap4 == 1)
{
Print("Thermal Detonators");
}
if(vicweap5 == 1)
{
Print("Bowcaster");
}
if(vicweap6 == 1)
{
Print("Repeater");
}
if(vicweap7 == 1)
{
Print("Rail Detonator");
}
if(vicweap8 == 1)
{
Print("Sequencer Charges");
}
if(vicweap9 == 1)
{
Print("Concussion Rifle");
}
if(vicweap10 == 1)
{
Print("Lightsaber");
}
Return;
# ........................................................................................

end


It still doesn't get past the Print("Weapon:") statement in the game, and I still can't target. I moved the "potential = victim" to pulse because if I moved it to deactivated it wouldn't know what to look for in the targeting reticule, would it?

jh

[Hideki - Please use code tags]

[This message has been edited by Hideki (edited March 01, 2001).]
2001-03-01, 4:12 AM #12
There are quite a few parts to fix, so I just did for you.

Code:
# Jedi Knight Cog Script
#
# force_sense.COG
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols

int player local
int potential local
int victim local

int vichealth local
int vicmana local
int vicweap local
int vicmodel local

message activated
message pulse
message deactivated
message user0

end

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

code
activated:

	player = GetSourceRef();
	victim = -1;
	SetPulse(0.1);

	Return;

#........................................................................
pulse:

	//now lets attempt to find a victim without an LOS[edit]let's keep the LOS until we can get this
	//thing to do otherwise

	potential = FirstThingInView(player, 180, 40, 0x404);

	while(potential != -1)
	{
		if(potential != player)
		{
			//now lets target a victim
			victim = potential;
			JkSetTargetColor(12,13,14);
			JkSetTarget(victim);
		}

		potential = NextThingInView();
	}

	return;

#........................................................................
deactivated:

	if(victim == -1) return;

	vichealth = GetHealth(victim); //this is the victim's health
	vicmana = GetInv(victim, 14); //this is the victim's mana
	vicweap = GetActorWeapon(victim, 1); //does the vic have fists out?
	vicmodel = GetThingModel(victim); //what's the vics 3do

	//kill the cone!!!!
	JkEndTarget();

	//and tell the player how that victim is doing
	print("The probe results:");

	//The model of the probed victim
	SendMessage(GetSelfCog(), user0, 0, vicmodel, 0, 0);

	//The health of the probed victim
	SendMessage(GetSelfCog(), user0, 1, vichealth, 0, 0);

	//The mana of the probed victim
	SendMessage(GetSelfCog(), user0, 2, vicmana, 0, 0);

	//weapon time
	//*groans*
	SendMessage(GetSelfCog(), user0, 3, vicweap, 0, 0);

	return;

#........................................................................
user0:

	jkStringClear();

	if(GetParam(0) == 0) jkConcatAsciiString("Model:");
	else
	if(GetParam(0) == 1) jkConcatAsciiString("Health:");
	else
	if(GetParam(0) == 2) jkConcatAsciiString("Mana:");
	else
	if(GetParam(0) == 3) jkConcatAsciiString("Weapon:");

	jkStringConcatInt(GetParam(1));
	jkStringOutput();

	return;

#........................................................................

//	Print("Fists");
//	Print("Bryar");
//	Print("Stormtrooper Rifle");
//	Print("Thermal Detonators");
//	Print("Bowcaster");
//	Print("Repeater");
//	Print("Rail Detonator");
//	Print("Sequencer Charges");
//	Print("Concussion Rifle");
//	Print("Lightsaber");

#........................................................................

end


"GetActorWeapon" is probably returning the template ID of the primary weapon.

Since it returns some integers like 17, 35 etc, I guess so.

Try to use Force Pull method to get what the actual weapon the victim has.

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

[This message has been edited by Hideki (edited March 01, 2001).]
2001-03-01, 4:41 AM #13
Well, 0 returns if the target doesn't have the weapon, because when I told it to print the weapon if it were 0, and when I pressed the button, it listed all the weapons. Now, to make it recognize MotS weapons shouldn't be too hard. I'll repost the code once the thing does something new(I'm about to test it now).

jh
2001-03-01, 4:44 AM #14
You posted while I was testing and edited the above message and code.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-01, 5:18 AM #15
I modified it a tad, and now it almost works perfectly. I just need to know a little about some of the numbers I was given.

1. Are there specific model numbers, like the bin numbers for weapons?

2. How much health do the rebel soldiers in MotS level one have? It's telling me number above one hundred.

If I can figure these two out, I can maybe set up a small database of models in the cog, and then make it print what their model name. And then I have to figure out what this thing with the weapons is. I think I'm getting bin numbers.

jh
2001-03-01, 1:15 PM #16
1. I guess it's only returning the ID ordered in jkl files of the level, just make it a database by printing out the model ID and matching the names.

2. Just check the first level jkl file from MotS.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-01, 2:46 PM #17
Well, I got a 42 model number from the Rebel Soldier. But that was from my edited version of the old cog you posted. Your new version doesn't seem to get farther than "Probe results:". I don't know what I'm doing wrong, but it doesn't work. Once I make a few changes with some of the if statements, I'll post it. My current if statements are like this:

if(so and so == so and so)
{
do this and that;
}

I think it should be like this:

if(so and so == so and so) do this and that;

Am I thinking correctly?

jh
2001-03-01, 2:59 PM #18
There is nothing wrong with the first one.

------------------
Together we stand.
Divided we fall.
2001-03-02, 2:53 AM #19
Well, I thought so too, but it never works with the other way. But it also never works with the original. Here is an exact copy from one of my several copies which I test, modify, and test:

if(vicweap == 1)
{
Print("Stormtrooper Rifle");
}
else
{
Print("Unknown Weapon");
}

I check it very carefully, and look at it from every angle. Every possible use for the GetActorWeapon() and GetInv(victim, 123) function, and it never returns a bin number or a true-false number. It always returns Unknown Weapon. Any ideas. Dumb mac keyboard,, never prints whay I ptess. I'm never using a public computer to type again. Or at least not for a long time.

jh
2001-03-02, 5:32 PM #20
I did some further tests, and I still cannot get any idea what the weapon part is returning. Also, if I'm going to build the model database thing into this cog, will all levels return the same numbers for the same model, or will custom-made levels be different from MotS levels?

This is the confusing part, I think.

I'll post the results of some further tests that will probably answer my above question.

jh
2001-03-02, 8:59 PM #21
I guess, it refers to the order in the jkl file, so maybe it won't work, but not too sure.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-04, 10:37 AM #22
You're right, Hideki. It's the jkl file. I checked it with another level, and found that it also won't work for any custom levels which have an order different from the MotS jkl in the models section. Is there any other way to get models? I really don't think it would be worth it to go through and make a database for each level just so you could use it.

I also think I fixed the if problems, so no more of that. [http://forums.massassi.net/html/smile.gif]

jh

[edit]I think I found a better weapon reader, but it's a MotS only. It's the GetWeaponBin. I think I could also use this for mana, and I'll check on the health. But this could be bad, too. If we ever convert for JK, it might be a pain, though.

[This message has been edited by Jedi Howell (edited March 04, 2001).]
2001-03-04, 11:03 AM #23
How about getting the name of the template, if it matches to a database of actor names, then you might get a better chance.

I think, I just thought that you might be able to match

GetActorWeapon(victim, 1);

with

template weap0=+bryarbolt local

so,

if(GetActorWeapon(victim, 1) == weap0)
{
//he must have bryar or same sort of weap!
}

Just some ideas...

------------------
http://millennium.massassi.net/ - Millennium
2001-03-04, 11:40 AM #24
The template idea might work. I'll post my (hopefully unfutile) efforts once I test and stuff.

jh

PS:Cogging is alot harder than HTML! [http://forums.massassi.net/html/wink.gif]

[edit]I started work, and I have 1 question:
1. Which is more commonly used, for stormtroopers for example, the one with suffix "_m" or the one without?

Thanks again,
jh


[This message has been edited by Jedi Howell (edited March 04, 2001).]
2001-03-04, 12:35 PM #25
It doesn't work. I'm going to fiddle with it a little, and see. I haven't tested the actor weapons, but the models part doesn't seem to work. There must be a way to get this to work.

jh

[edit] *everbody: Quit with the edits and the new messages, and get a life!*

Anyways, I think I have an idea. Can you make, say a constant called "24" if the cog refers to "24" from another file, and have them work if both "24"s are equal?

My idea is to create constants for all the actor jkl numbers, and place them in-cog, so that the thing won't look for them elsewhere. That way,the operations are mostly in-cog, therefore removing the need to look at the MotS jkl file, and thus allowing home-made levels. Will it work? I'll post real soon.

jh(again)



[This message has been edited by Jedi Howell (edited March 04, 2001).]
2001-03-04, 3:30 PM #26
1. You can check a few level jkl file and look at the stormtrooper templates and see what's most common.

Just get a database of model names and just match them using a "for" loop.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-05, 1:28 PM #27
Well, my "number" constants aren't working. Is there some way to call up this thing I'm trying to do? Here's what I'm thinking:
code
wherever:
vicmodel = CheckUser1(3do, victim);
if(vicmodel == user1(3do#)) Print("Stormtrooper");
else{Print("Unknown Model");}
return;
#.........................................
user1:
3do#: 3do file
return;
end

Any way to do that kind of thing?

jh
2001-03-05, 2:04 PM #28
Think I might have solved the problem. The only thing is that it's left me behind completely. Help!!!
Code:
# Jedi Knight Cog Script#
# force_sense.COG
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols
int          player                             local                         
int          potential                          local                         
int          victim                             local                         
int          vichealth                          local                         
int          vicmana                            local                         
int          vicmodel                           local                         
int          VicMRef                            local                         


template     weap2=+bryarbolt                   local                         
template     weap3=+stlaser                     local                         
template     weap4=+grenade2                    local                         
template     weap7=+raildet2                    local                         
template     weap6=+repeaterball                local                         
template     weapM4=+flashbomb2                 local                         
template     weap5=+crossbowbolt                local                         
template     weap8=+seqchrg                     local                         
template     weap9=+concbullet                  local                         
template     weap0=+carbpellet                  local                         

template     rebcommand=rcommando               local                         
template     st=stormtroop_m                    local                         
template     stb=st_11_m                        local                         
template     fst=stormtroop2                    local                         
template     ft6=stormtroop3                    local                         
template     ft7=stormtroop4                    local                         
template     rebofficer=rofficer                local                         

message      activated                                                        
message      pulse                                                            
message      deactivated                                                      
message      user0                                                            
end                                                                           
#========================================================================================

code
startup:
VicMRef = -1;

#........................................................................
activated:	
player = GetSourceRef();	
victim = -1;	
SetPulse(0.1);
Return;
#........................................................................
pulse:	
//now lets attempt to find a victim without an LOS	
potential = FirstThingInView(player, 180, 40, 0x404);	
while(potential != -1)	
{		
if(potential != player)		
{			
//now lets target a victim			
victim = potential;			
JkSetTargetColor(04,05,06);			
JkSetTarget(victim);		
}		
potential = NextThingInView();	
}
return;
#........................................................................
deactivated:	
if(victim == -1) return;	
vichealth = GetHealth(victim); //this is the victim's health	
vicmana = GetInv(victim, 14); //this is the victim's mana		
vicmodel = GetThingTemplate(victim);//the vic's template
//kill the cone!!!!	
JkEndTarget();	
//and tell the player how that victim is doing	
///Print("The probe results:");	
//The model of the probed victim	
Print("Model:");
if(vicmodel == rebcommando) Print("Rebel Commando"); VicMRef = 3;
if(vicmodel == st) Print("Stormtrooper Regular"); VicMRef = 3;
if(vicmodel == rebofficer) Print("Rebel Officer"); VicMRef = M2;
if(vicmodel == ft6) Print("Field Trooper"); VicMRef = 6;
if(vicmodel == ft7) Print("Field Trooper"); VicMRef = 7;
else{PrintInt(vicmodel);}
	
//The health of the probed victim	
///Print("Health:");
///PrintInt(vichealth);

//The mana of the probed victim	
///Print("Mana:");
///PrintInt(vicmana);
	
//the weapon of the vic	
///Print("Weapon:");
if(VicMRef == 3) Print("Stormtrooper Rifle");
if(VicMRef == M2) Print("BlasTech Pistol");
if(VicMRef == 6) Print("Imperial Repeater");
if(VicMRef == 7) Print("Rail Detonator");
else{PrintInt(VicMRef);}

Sleep(5);
Print("    ");
Print("    ");
Print("    ");
Print("    ");
Print("    ");
return;
#........................................................................
user0:	
jkClearString();	
jkConcatAsciiString(GetParam(0));	
jkConcatInt(GetParam(1));	
jkStringOutput();
return;
#........................................................................
//	Print("Fists");
//	Print("Bryar");
//	Print("Stormtrooper Rifle");
//	Print("Thermal Detonators");
//	Print("Bowcaster");
//	Print("Repeater");
//	Print("Rail Detonator");
//	Print("Sequencer Charges");
//	Print("Concussion Rifle");
//	Print("Lightsaber");
#........................................................................
end


What's wrong with it?

jh
2001-03-06, 6:15 AM #29
Fixed it. It was something to do with the GetThingTemplate funtion.

But, yet again, more bad news(besides the fact that I'm posting again). The GetThingTemplate function returns a number that is not universal for that model. Stormtroopers are 90 on MotS LEC 1, and 261 on MotS Meeting on Balfor(MikeC's). Is there a way to get a universal template or model number?

jh
2001-03-06, 12:21 PM #30
How about

Code:
symbols

model st0=st0.3do local
model st1=st1.3do local
.
.
.

code

for(i=0; i<=max; i++)
{
   if(GetThingModel(victim) == st0)
   {
       print("this is stormtrooper");
   }
   else
   if(GetThingModel(victim) == tus0)
   {
       print("tusken here");
   }
.
.
.
}


Stuff like this?

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

[This message has been edited by Hideki (edited March 06, 2001).]
2001-03-07, 12:48 AM #31
What does "i" mean? And the max is the mximum models there are, right?

This is starting to make sense to me...

I'll try it, and fool around with it until it breaks the entire thing, and then I'll hope I can fix it. [http://forums.massassi.net/html/wink.gif]

jh
2001-03-12, 4:27 PM #32
As lordvader said:
"Bump!"


[This message has been edited by Jedi Howell (edited March 12, 2001).]
2001-03-13, 6:06 AM #33
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Jedi Howell:
As lordvader said:
"Bump!"


</font>


Why do I do this? So I can be at the top. Then people notice the subject! [http://forums.massassi.net/html/wink.gif]


[This message has been edited by Jedi Howell (edited March 13, 2001).]
2001-03-13, 11:57 AM #34
Post something relative.

As for "i", you don't have to worry about that.

The "max" is the max number of models.
But I think it is safe to set the max for each of the model database, if you need to check all of the models.

Code:
symbols
model st0=st0.3do local
model st1=st1.3do local
int StormMax=2 local
.
.
.
code

for(i=0; i<=StormMax; i++)
{
   if(GetThingModel(victim) == st0)
   {
       print("this is stormtrooper");
   }
}

for(i=0; i<=TuskenMax; i++)
{
   if(GetThingModel(victim) == tus0)
   {
       print("tusken here");
   }
}
.
.
.



------------------
http://millennium.massassi.net/ - Millennium
2001-03-15, 1:55 AM #35
The consistency checker is sending me messages. With the "i++" part, specifically. I tried a few things, but it either makes it worse or doesn't help period. The thing seems to expect me to add it to something. Otherwise, I think it should work. Since I only test this thing in level 1 MotS I changed some of the templates. But it should still work, right?

Should I put "i" as an int or just forget about it completely?

jh

[This message has been edited by Jedi Howell (edited March 15, 2001).]
2001-03-15, 8:19 AM #36
Ah, the cog doesn't understand "i++" function.

Rather put it as "i=i+1".
Means the same, but cog doesn't know the former form.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-16, 1:46 AM #37
It works! I currently have a database of 6 models, all in MotS level 1.

Is there a way to find out what the model of the gun that a person is holding? I know about GetActorWeapon and GetThingWeapon, but I need something for both actors and players.

jh
2001-03-18, 3:51 PM #38
OK, I think I know what I'm going to do, if I this assumption is right:

That with GetCurWeapon you can use with a victim, since in the JKSpecs it specifies the player, therefore I figure you could specify something else. Is this right?

and that somebody can answer this question:

For the above verb and GetActorWeapon, what will it return? I'm going to try, but it would be nice if someone could tell me first.
I keep getting a -1 for everything.

Thanks,
jh

[This message has been edited by Jedi Howell (edited March 19, 2001).]
2001-03-19, 3:58 AM #39
Look carefully.

GetActorWeapon(victim, 1);

You have to put the 1 after the victim, it will get its primary weapon, if it has "weapon2" in the template, like smacking with raildet/etc, you need to use (victim, 2) for that.

I think it will probably return the template, as SetActorWeapon can set enemie's weapon specifying templates.

------------------
http://millennium.massassi.net/ - Millennium
2001-03-19, 6:22 AM #40
I think I'm doing something wrong. I'm having it either tell me the vic has a strifle and print the return or just print the return. I keep getting the number 23. Here's the related piece of code:
Code:
symbols
template stormtroop=stlaser local
end

code:
single:
HasWeap3=GetActorWeapon(victim, 1)
if(HasWeap3 == stormtroop)
    {
    print("ST Rifle");
    printint(HasWeap3);
    }
else{printint(HasWeap3);}


Anything wrong?

jh

[This message has been edited by Jedi Howell (edited March 19, 2001).]

[edit]Rail gun gives me 47...Can't find these numbers in anywhere. The only place I could think of is items.dat. It might find the number, then subtract 100. This would get it 23 for the strifle, but this would contradict the info for the rail gun. Any ideas on where this might be listed?[/edit]

[This message has been edited by Jedi Howell (edited March 19, 2001).]
12

↑ Up to the top!