Search found 42 matches

by Stoo
2012-09-30, 22:13
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Yes, there is a powerful backend that handles all caching and compression. Writing the same data twice essentially sends no bytes at all across the wire, no matter how large the data written in DoSerialize() is (within limits). That's the real beauty of these methods. :cheesy: Ooh, that'll be handy...
by Stoo
2012-09-27, 01:33
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Ok, that sounds good. For the first half of the problem, I've just created this ticket that I intend to implement very soon: http://trac.cafu.de/ticket/123 That would be helpful; though for me it was more of a gotcha than anything else... especially since my vehicle code didn't need to be added to ...
by Stoo
2012-09-25, 13:22
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Did you add the ScriptTracker to the AllTypeInfos list in file GameImpl.cpp ? This is the result of a very unfortunate technical problem, as the comment above the AllTypeInfos list explains, and I just realize that we really need better diagnostics for this case. Didn't know about that one... that ...
by Stoo
2012-09-21, 03:48
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Ah! Not sure how I missed this... I do have a warning: Warning: No type info found for entity class "ScriptTracker" with C++ class name "EntScriptTrackerT". Where would this type info be? Like I said, I've got it in the EntityClassDefs.lua, and I've got all the speaker refs switched over to ScriptTr...
by Stoo
2012-09-20, 13:29
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

The instance I placed in the map file has a name, if I understand you right - if I select it in the map editor, the object properties window says Entity "ScriptTracker_001" of class "ScriptTracker" is selected. Is there another name it needs to have? I can't access it from the map script, either... ...
by Stoo
2012-09-19, 13:13
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Okay... finally got back to this piece again... and I'm stymied again :oops: I have a data-tracking entity (ScriptTracker) defined and added to the map, but I can't figure out how to reference it from the GUI's Lua environment - I keep getting "attempt to index global 'ScriptTracker_001' (a nil valu...
by Stoo
2012-09-11, 03:22
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 7608

Re: Adding vehicles

Okay... after catching up to 2 version updates, tracking down another bug, and various cleanup items... patch submitted! http://trac.cafu.de/ticket/121 Let me know if I need to adjust anything on it, clean it up more, etc... there's a lot of debug data still in right now; so the output will be chatt...
by Stoo
2012-08-30, 01:13
Forum: Coding and Scripting
Topic: dynamic map generation
Replies: 10
Views: 5173

Re: dynamic map generation

While Stoo's description is technically right and very appealing, afaik this has never been tried before, and I fear that the actual results and current implementation may (initially) not meet the expectations. Quite true! I'm planning to implement something similar to what you described, but not f...
by Stoo
2012-08-29, 13:23
Forum: Coding and Scripting
Topic: dynamic map generation
Replies: 10
Views: 5173

Re: dynamic map generation

I think what you're wanting to do can be accomplished using the script, but I think you'll need to define some new static "room" objects as well, and some kind of marker object to indicate where the randomized rooms should go. Try this simpler example: Let's say you've got a map consisting of a hote...
by Stoo
2012-08-25, 01:40
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

If you use r561, (only) the State structure (in r561 still a member of BaseEntityT ) is sync'ed. This is done in entity methods (Do)Serialize() and (Do)Deserialize() , which are defined in BaseEntityT and overridden in the concrete derived entity classes. That is, for adding more variables (that ar...
by Stoo
2012-08-25, 01:29
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 7608

Re: Adding vehicles

Well, I'd hoped to polish the code a bit more than this before posting it; but it's been a busy week, and I don't want to risk getting sucked into making it *absolutely* perfect. Plus, I'm still on r561, and don't want to fall too far behind :P So, heads up, massive code blocks ahead! :lol: I've add...
by Stoo
2012-08-18, 17:15
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

My main point was that in Cafu you cannot (easily) "freely" communicate with the server, at least not - as far as I understood your posts - in a way you think you can. ;-) However, the networking code automatically sync's the state of entities: The state that an entity has on the server is automati...
by Stoo
2012-08-18, 16:17
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 7608

Re: Adding vehicles

It works!!! :cheesy: :cheesy: :cheesy: :groupwave1: ...well, mostly :oops: Right now the player can hit the activate key; and if it detects a vehicle, the player's state will be set to Piloting, the player will forward all commands to the vehicle, and the vehicle will respond to the command queue (r...
by Stoo
2012-08-13, 19:24
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Ah! This seems to be the essence! This is possible, but in a slightly different manner than you phrased it: The script-defined variable that is stored on the server to be read by a client 2D GUI should in fact be a separate entity: imagine an invisible "manager" or "rulekeeper" entity, that keeps a...
by Stoo
2012-08-07, 01:53
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 13076

Re: Calling script functions from code

Hi Stoo, I have to admit that I didn't fully understand what you want to accomplish (more about that in a moment), but before I attempt to make any suggestions: What version of the code do you currently use? Yeah... I didn't really think about the fact that I was going to need this until I ran up a...