#gemrb@irc.freenode.net logs for 29 Oct 2012 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage


[00:00:36] <lynxlynxlynx> mhm
[00:01:09] <lynxlynxlynx> after the release we can experiment with assert(target), but it's not safe now, especially without taking a deep look
[00:02:22] <lynxlynxlynx> a bit contrived exercise, but some defensive code can't hurt
[00:02:28] <lynxlynxlynx> zzz
[00:03:06] <rocket_hamster> how can i reference object in method?
[00:03:16] <brada> i dont get how assert(!target); makes any sence there
[00:03:21] <brada> sense
[00:03:34] <rocket_hamster> it doesnt :)
[00:03:50] <brada> if anything it should be assert(target);
[00:04:13] <brada> if tharget is null you will crash on the next line
[00:04:14] <-- lynxlynxlynx has left IRC (Read error: Connection reset by peer)
[00:04:54] <rocket_hamster> yes
[00:04:58] <brada> what do you mean by "reference object in method"?
[00:05:19] <rocket_hamster> if you call someobject.dothis(); how do you make reference to it inside that method?
[00:05:27] <rocket_hamster> by this?
[00:05:32] <brada> using this of course :)
[00:05:35] <rocket_hamster> btw this should be more reasonable http://fpaste.org/wcTB/
[00:06:14] <brada> that looks better, but i cant sign off on it
[00:06:49] <brada> you dont need to use this to use ivars tho if thats what you want to do
[00:07:17] <rocket_hamster> ivars?
[00:07:21] <brada> or even to call other methods
[00:07:26] <rocket_hamster> im more of ansi c guy
[00:07:28] <brada> ivars = instance variables
[00:07:30] <rocket_hamster> c++ is new to me
[00:07:32] <rocket_hamster> oh
[00:08:04] <rocket_hamster> so it could be target->IsInvisibleTo(Scriptable *)
[00:08:06] <brada> you only NEED to use this to do something defined in a super class i think
[00:08:33] <brada> prolly shouldnt listen to me
[00:08:36] <rocket_hamster> xD
[00:08:55] <brada> you can just do super::supermethod()
[00:08:55] <rocket_hamster> ill see what lynx says to that tommorow
[00:09:22] <brada> but to answer your question no, in that case yo do need to use this
[00:09:39] <rocket_hamster> yes but i need to call method for some object with parameter from method im currently in
[00:09:43] <brada> (im not a c++ coder either)
[00:10:23] <brada> ok so if the parameter you need to call on is a pointer just do object->method()
[00:10:30] <brada> otherwise object.method()
[00:10:38] <rocket_hamster> nono i mean:
[00:11:05] <rocket_hamster> im calling actor.PerformAttack and inside perform attack i need to call another method for another object and parameter of that method is Actor
[00:11:43] <rocket_hamster> so i need to make reference to actor and insert it as parameter of that method
[00:11:53] <rocket_hamster> in this case its IsInvisibleTo
[00:11:58] <brada> ok
[00:13:25] <brada> um Actor is a Scriptable btw
[00:14:04] <brada> so why would you need to pass another actor?
[00:15:32] <brada> if you are passing in an actor to IsInvisibleTo then you can safely cast the scriptable as an actor
[00:17:13] <rocket_hamster> i need to pass actor for which upper method is called
[00:17:29] <brada> use the "type" ivar to determine if the scriptable is an actor
[00:19:01] <brada> im confused. IsInvisibleTo ought to only determine if the passed scriptable is invisible to the receiver. why would you need a separate actor object to make that determination?
[00:20:42] <rocket_hamster> objects
[00:20:53] <rocket_hamster> reciever and checked obj
[00:21:03] <rocket_hamster> 2 objects*
[00:21:45] <rocket_hamster> in this case PerformAttack is called for an object and that object is parameter of IsInvisibleTo
[00:21:49] <brada> right. i still dont understand why you would need additional parameters to make the required determination
[00:22:03] <brada> sounds like you are trying to make that method do something it shouldnt
[00:22:55] <rocket_hamster> well that method needs parameter
[00:23:20] <brada> yes it needs a single scriptable :)
[00:24:15] <rocket_hamster> and object for which it is called
[00:34:15] <-- exultbot has left IRC (signing off...)
[00:36:05] --> exultbot has joined #gemrb
[00:36:05] --- Topic for #gemrb is: GemRB 0.7.1 | http://gemrb.org | Something wrong? State your exact version and CHECK THE GEMRB LOG | Be wary of your thoughts for there are Illithid present: http://log.usecode.org/gemrblog.php | import pdb; pdb.set_trace()
[00:36:05] --- Topic for #gemrb set by lynxlynxlynx!~quassel@sourcemage/warlock/lynxlynxlynx at Sun Jul 15 20:24:02 2012
[01:18:39] <-- rocket_hamster has left IRC (Read error: Connection reset by peer)
[01:33:18] <-- brada has left IRC (Quit: brada)
[01:41:43] --> rocket_hamster has joined #gemrb
[02:20:07] <-- rocket_hamster has left IRC ()
[05:14:22] <-- edheldil_ has left IRC (Ping timeout: 265 seconds)
[05:26:04] --> edheldil_ has joined #gemrb
[05:38:56] <-- edheldil_ has left IRC (Ping timeout: 268 seconds)
[07:14:00] --> edheldil_ has joined #gemrb
[07:37:00] <-- edheldil_ has left IRC (Ping timeout: 244 seconds)
[08:18:08] --> edheldil has joined #gemrb
[08:18:08] --- ChanServ gives channel operator status to edheldil
[08:23:08] <-- edheldil has left IRC (Ping timeout: 252 seconds)
[08:25:55] --> edheldil has joined #gemrb
[08:25:55] --- ChanServ gives channel operator status to edheldil
[08:31:02] <-- edheldil has left IRC (Read error: Operation timed out)
[08:34:27] --> edheldil has joined #gemrb
[08:34:30] --- ChanServ gives channel operator status to edheldil
[08:54:15] <edheldil> Hi all and a happy new Monday! :)
[10:22:00] --> WingedHussar has joined #gemrb
[17:04:19] <-- WingedHussar has left IRC (Quit: WingedHussar)
[17:20:18] --> rocket_hamster has joined #gemrb
[18:04:58] <-- rocket_hamster has left IRC (Ping timeout: 252 seconds)
[18:38:59] --> edheldil_ has joined #gemrb
[18:40:45] --> kamui has joined #gemrb
[18:43:30] <-- edheldil_ has left IRC (Ping timeout: 244 seconds)
[19:56:47] --> edheldil_ has joined #gemrb
[21:05:58] --> rocket_hamster has joined #gemrb
[23:07:11] <-- rocket_hamster has left IRC ()