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 → Mask Values...datamaster...sabers and actors
Mask Values...datamaster...sabers and actors
2003-10-10, 9:36 AM #1
Hi, I'd just like to open a bit of discussion regarding sabers for actors in multiplayer. It would be cool if I could get this to work, and would be a benefit to rbots as well as synced ai.

Raynar said in some of his past rbots posts that it isn't possible to give an actor a saber in multiplayer. (rbots sabers are simulated) Now he said he'd been trying to do it for a year and since he isn't exactly a n00b cogger I should have taken his word for it, but I had to know for myself. After some swearing and testing I came to the same conclusion.

It seems that the only way to assign an actor a saber, and have it actually do so is through a level cog (one assigned in the jkl) This doesn't work because it has to be assigned to an enemy that is placed in the level jkl, as appossed to spawned. And since enemies placed in the jkl won't appear in multiplayer there is no way to give them a saber through cog. Follow that? [http://forums.massassi.net/html/smile.gif]

I'm out of ideas. The real kicker is the jkflags for a saber are set when you set them...I've run checks with jkgetflags and confirmed they were on, JK/MotS just doesn't bother to do anything with the flags like its suppose too.

There's one last thing that I'm unsure of though...

Ok, so I've noticed the dark jedi have a mask value of 0xfff in their cog for the setting that you define the actual darkjedi thing with. I think this flag might be the reason that they work.

My understanding of the mask values and what the heck they are for is pretty limited, and DataMaster tended to confuse me at least as much as before. The only thing that I got was

"Mask Flags can only be used with objects whose values are passed from the level's JKL."

Which means to me, again, there is no way to apply this flag outside of a in level cog. Back to square one again.

Does anyone have any ideas, experiences, etc about how to get around this problem? I'd rather not create a new saber system for synced AI when there's a good one built into the engine. But if I have too...I can't see a way to make work any better than rbots simulated saber system, which raynar himself said was less than stellar.

------------------
2003-10-10, 3:53 PM #2
You can't use AI (as far as logic) in MP because it won't sync (though it works fine locally). But if you code your own AI, you *may* be able to use JK's AI saber system - i.e., write a cog for moving/syncing the actor which also set the actor's flags and enable / disable the saber. Raynar probably had a good reason for not trying this, but I think you can manipulate the JK Flags and keyframes to make the saber work seperately from the AI logic.

* begins to fall asleep [http://forums.massassi.net/html/redface.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-10-10, 4:11 PM #3
I was basing this off of Nightmare's AI cogs, which I planned to tweak to make them just a tad smarter.

Raynar didn't apply the sabers in the way I would like to because it isn't possible. At least, I don't think so. Unless the jkflags are applied with one of the dark jedi cogs included in the level jkl, it won't make a working saber at all. Single Player, Multiplayer, synced or unsynced. It just won't do it.

SM, could you explain the mask value in the symbols section. I understand there are different typed (btw, what would 0xfff refer too?) but what is it used for exactly?

------------------
2003-10-10, 4:50 PM #4
I've made jedi actor cogs where it assigns the saber to the actor on startup using no level cogs, I'm still working on the MP syncing part of it.

I think you could have a level cog (run locally so it doesn't lag) that checks all the things in a level for a certain template, and assign the flags to that when it is created.
Just a thought...

------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2003-10-11, 5:00 AM #5
Really StormTrooper? And it worked?

How was it assigned? At creation through a generator cog, or through a class cog?

You wouldn't mind posting the cog would you? This would help me out tons if you figured out how to do it.

Edit: I thought of using a thing checker cog, but it just didn't seem like it would do anything other cogs weren't doing. I'll have to try that though.

------------------


[This message has been edited by Wave_Of_Mutilation (edited October 11, 2003).]
2003-10-11, 9:52 AM #6
Well, I've confirmed that a saber CAN be assigned through a class cog on the darkjedi actor. However, when I try creating the enemy through a generator cog AFTER the game has started the saber does not work. This was all in a single player test too mind you.

Seems like this is a lost cause.

------------------
2003-10-11, 5:53 PM #7
Here's the cog, It's a class cog.
Code:
# Jedi Knight Cog Script
#
# ACTOR_JEDINF2.COG
#
# DARK JEDI Script - Actor Version, No Force
#
# [ST]
#
# NOT SUPPORTED by LucasArts Entertainment Co.

symbols

message      damaged                                                          
message      killed                                                           
message      created                                                          
message      skill                                                            

thing        darkjedi                           local

flex         damage                             local                         
int          damageType                         local                         

material     tip_mat=saberblue0.mat           local                         

material     side_mat=saberblue1.mat          local                         

template     tpl_wall=+ssparks_wall             local                         
template     tpl_blood=+ssparks_blood           local                         
template     tpl_saber=+ssparks_saber           local                         

end                                                                           

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

code

created:

  darkjedi = GetSenderRef();
  jkSetPersuasionInfo(darkjedi, 8, 16);  //copied from newplayer message
  jkSetSaberInfo(darkjedi, side_mat, tip_mat, 0.003, 0.001, 0.100, tpl_wall, tpl_blood, tpl_saber);
  jkSetFlags(darkjedi, 0x5);  //copied from newplayer message
return;

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

killed:

   darkjedi = GetSenderRef();

   ClearActorFlags(darkjedi, 0x80);
   jkClearFlags(darkjedi, 0x20);
   SetThingCurGeoMode(darkjedi, GetThingGeoMode(darkjedi));

   jkSetFlags(darkjedi, 0x8);

   Return;

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

skill:
   bin = GetParam(0);
   if(bin = 24)                             // Force Pull
   {
      ReturnEx(-1);
      Return;
   }
   
   ReturnEx(-1);
   Return;


end


It crashes when you try to create it in game, If I take out the jkSetPersuasionInfo(); out, it will create it without the saber, I'm guessing CreateThing(); doesn't like JKSPI(); too much. Maybe I'll try CreateThingAtPos(); and see if that makes a difference.

------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2003-10-12, 2:58 AM #8
JKSPI() does cause it to crash when spawned. But the actor will still have a saber if you remove that verb anyway. However, it still won't make one when it is spawned. The 0x1 jk flag does not appear to be applied, as some testing with jkgetflags() proved.

I guess Raynar was correct. A object that was not placed in the level's jkl cannot be given a saber. And since AI's that are placed in a level's jkl do not show up in multiplayer games, you cannot have actors with sabers in multiplayer.

I guess I'll just have to do saber projectiles instead...that sucks.

------------------
2003-10-12, 4:24 AM #9
ive been able to give actors that are are created in MP a saber (MotS only though, havent tried JK but it should work).
ive made one that uses an AI file to work and one that uses a cog to just follow me around and swing at me when im close enough, he uses jkEnableSaber() to do damage (died many times because of them).
i can show you the cog if you want but i had to make a new TPL, PUP, and SND file for it. it uses the KY.3DO too. actrually it can use any of the player 3dos. because the cog gives the actors 3do the saber weapon mesh with jkSetWeaponMesh().
or if you want i could send you a demo level that uses them.

oh and to find out what the mask=0xfff means just go into jed select a thing and do the Add Value - THINGFLAGS then type in 0xfff and look at what ones are selected and then compare them to what DataMaster has in those same spots.
so... from what i can tell it looks like the mask=0xfff uses all the mask flags at once.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited October 12, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-10-12, 8:37 AM #10
DeathSythe, I never thought of just using jkenablesaber(), I always assumed you need to set the flags for collision...I'm really curious to see how you did it. Would you mind sending me that demo level? I edit for MotS too, so thats fine.

My email is jesseSPAMsimpson@yahoo.com

(Remove the word SPAM, I'd rather page readers didn't pick up that address since its relatively spam free still.)

Thanks.

------------------
2003-10-12, 11:05 AM #11
sent it to you, post back if you have any questions comments or for some reason dont get it.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2003-10-12, 1:37 PM #12
Awesome, thank a TON man. Seriously. I have no idea why, but setting the weaponmesh of all things seemed fix the problem. I thought of it as a cosmetic change so I hadn't bothered to apply it while I was testing. Go figure. I'm glad you chimed in when you did, I'd just given up on it.

Cool level idea btw, and nice design. I'm assuming you're going to be writing some kind of synced AI from scratch. (at least, thats what it appeared to be you were doing)

------------------
2003-10-12, 2:54 PM #13
ya i was going to try and make an AI sync cog, but like most projects it lost interest and i lost time to work on it.
latly ive been poking at it here and there but i havent gotten very far.

anyways, good to hear you got it to work.
glad i could help.


------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2003-10-13, 3:50 AM #14
One thing I thought was interesting, was the way you ignited the saber blade...jkenablesaber() doesn't work unless you set the things type to 10 (player) for at least a second. What made you think of trying that to get around the problem? I never even would have thought the thing type had anything to do with the saber not enabling.

Btw, I'm assuming it was implied by you sending me the unfinished mod...but I'd like to formally ask permission to use parts of the cog in my own work. I also may try to apply this to rbots, since it is sorely in need of a proper saber system. Of course you will be credited should ever actually release it.

------------------
2003-10-13, 4:37 AM #15
Why not make a new Bot system? Editing a code that few people save Rynar trully understand may do well, but think of the possibilities of doing a brand new project? Rynar's code was great, but he didn't think to write it with the reader in mind. Perhaps if you could come up with a system that allowed readers to fully edit the code for their levels would be more helpful then editing very dirty code as it is. I've been secretly following this thread in hopes for a new Bots system, so now I'll take a hands on grasp with it: MAKE A NEW RBOTS.

omqthnxbye

JediKirby

------------------
"I was driving along listening to the radio, when Judas Priest comes on. It was 'You've got another thing coming.' All of a sudden, I enter 'VICE CITY RAMAGE MODE' and nearly ran some guy over"
- ]-[ellequin
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2003-10-13, 5:14 AM #16
I tend to disagree with you on the rbots code, I thought it was at least above average regarding its commments when I was reading it last night. While it may be difficult to follow the code, a project that ambitious and involving that many cogs isn't going to be easy to make simple. I think Raynar and the others involved did a fairly good job coding the rbots.

I personally, do not really need another rbots, and thus have no intention of reinventing the wheel. I've only been looking through Raynar's code because I am planning on writing a synced AI system based somewhat off of it. It will be much less complex than the rbots because that is what will suit my purposes.

It would be a relatively easy modification to give the existing rbots working sabers though, so I've been considering doing that because of the rbots open source nature. If you would like to take on the project of coding a new bots system, I would be more than willing to help you out through the forums. But I barely have enough time to devote to my own projects, much less become a contributing member to some one else's.

------------------
2003-10-13, 7:55 AM #17
the jkEnableSaber() just wasnt working when i tried using it on an actor but i knew it worked on a player so i set the actors type to 10 (player). that made the jkEnableSaber() work but if the actors type is left at 10 and its killed the game crashed. so i just set the type back to 2 (actor) after i did the jkEnableSaber() and all was well.
only thing im not sure of is if you need to use jkDisableSaber() in the same way or if it is even needed when you use jkEnableSaber() that way. i never tested it.

yes you may use any of the cogs (whole or part) that i gave you.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2003-10-13, 2:51 PM #18
Would you mind maybe posting a snippit of the cog that changes the type to player? I've been trying to recreate it, but I keep getting nothing.

------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2003-10-13, 5:48 PM #19
Code:
SetThingType(darkjedi, 10);
jkEnableSaber(darkjedi, bla...bla...bla...);
SetThingType(darkjedi, 2);
thats all it is, short and simple.
course the bla...bla...bla... needs to be the right stuff.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited October 13, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-10-13, 8:05 PM #20
Sorry for the late response, but here's the deal with the mask flags.

Say, for example, you define a thing in the symbols. It's an actor and you want to receive a touched message when a bryarbolt hits it. Normally, bryarbolts won't cause touched to be called in the actor's cogs because the default thing mask (0x404) doesn't have the flag (0x8) for weapons (check the Mask flags in the DM). When you can use the mask symbol extension, you're able to change what messages are received by the cog - specifically what thing types are allowed to send (i.e., be the message senderref) messages to the cog. So if we put mask=0x8 after the thing's definition, only weapons will be able to send messages to the cog for that actor.

Using 0xfff is just a catch-all to make sure that the cog receives every message that's sent for the thing.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!