I am currently using Dreadnaught's approach, as a framework for later, it works up until the point that I am trying the SummonList verb to summon them.

Does nothing to be fair :)

Add_Player_SummonList(mob/M in world)
set category="GM"
set name="Add"
SummonList+=M
usr<<"You added [M] to the Summon List!"
Remove_Player_SummonList(mob/M in world)
set category="GM"
set name="Remove"
SummonList-=M
usr<<"You removed [M] from the Summon List!"
Summon_SummonList()
set category="GM"
set name="Summoner"
for(var/mob/M)
if(M in SummonList)
new/obj/immortality(M.loc)
M.freeze=1
sleep(10)
new/obj/immortalityfire(M.loc)
sleep(1)
M.alpha=0
sleep(1)
new/obj/immortality(locate(x,y-2,z))
sleep(10)
new/obj/immortalityfire(locate(x,y-2,z))
sleep(1)
M.alpha=initial(alpha)
sleep(1)
M.loc=(locate(x,y-2,z))
M.freeze=0
M.loc=usr.loc</m>

I thought it was the src.loc and src in SummonList so I tried to use for/var/mob/M to define it as mob and use M.loc instead. Now it gives me undefined var errors for them however.

Can someone point out what I am doing wrong, cause I don't really understand why it's not defined correctly, as well as why src in SummonList didn't work.
You need to be careful about indentation. You've been told several times that you need to indent code that goes inside of loops.

Further, I'd strongly recommend against Dreadnaught's approach. It's way overcomplicated for your needs. (No offense to Dreadnaught, of course)
Seijins I'd listen to Ter13, he knows what he's talking about.

(No offense taken I'm fairly new to dm, your criticism is always welcome @Ter13)
Already fixed it myself before Ter13 responded, it works like a charm now, and even called it from another verb.

Thanks for the help.

Lmfao no problem I guess.
In response to Seijinz
Seijinz if you actually cared about gaining some new knowledge in regards to dm and learning how to optimize your code for better results you would have listened to Ter13's previous reply to me.
Why do people just want to make accusations towards me?

I do care about learning hence I am currently reading guides about how to go around and using lists, and certain vars...

I won't respond to accusations from now on, if it's something similair what you just wrote, I will disregard it to prevent further pointless discussions.

Now I am going to try and figure out, why it adds the mobs to the list, but summon only one...
In response to Seijinz
Seijinz wrote:
Why do people just want to make accusations towards me?

I do care about learning hence I am currently reading guides about how to go around and using lists, and certain vars...

I won't respond to accusations from now on, if it's something similair what you just wrote, I will disregard it to prevent further pointless discussions.

Now I am going to try and figure out, why it adds the mobs to the list, but summon only one...


I'm surprised it'll even summon one o.o

Seijinz wrote:
        Summon_SummonList()
set category="GM"
set name="Summoner"
for(var/mob/M)
if(M in SummonList)
new/obj/immortality(M.loc)



I believe this'll just produce an error o.o



Currently I have it like this:

        Add_Player_SummonList(mob/M in world)
set category="GM"
set name="Add to Summon List"
SummonList+=M
usr<<"You added [M] to the Summon List!"
Remove_Player_SummonList(mob/M in world)
set category="GM"
set name="Remove from Summon List"
SummonList-=M
usr<<"You removed [M] from the Summon List!"
Summon_SummonList()
set category="GM"
set name="Summoner"
for(var/mob/M)
if(M in SummonList)
new/obj/immortality(M.loc)
M.freeze=1
sleep(10)
new/obj/immortalityfire(M.loc)
sleep(1)
M.alpha=0
sleep(1)
new/obj/immortality(locate(x,y-2,z))
sleep(10)
new/obj/immortalityfire(locate(x,y-2,z))
sleep(1)
M.alpha=initial(alpha)
sleep(1)
M.loc=(locate(x,y-2,z))
M.freeze=0
M.loc=(locate(x,y-2,z))


Which now summons all mobs I added to the list, infront of me, in quick succession, without errors, or lag...
Well then I'm glad you figured it out.
for(var/mob/M)
if(M in SummonList)

would be much better as
for(var/mob/M in SummonList)
In response to Seijinz
Seijinz wrote:
Currently I have it like this:

        Add_Player_SummonList(mob/M in world)
> set category="GM"
> set name="Add to Summon List"
> SummonList+=M
> usr<<"You added [M] to the Summon List!"
> Remove_Player_SummonList(mob/M in world)
> set category="GM"
> set name="Remove from Summon List"
> SummonList-=M
> usr<<"You removed [M] from the Summon List!"
> Summon_SummonList()
> set category="GM"
> set name="Summoner"
> for(var/mob/M)
> if(M in SummonList)
> new/obj/immortality(M.loc)
> M.freeze=1
> sleep(10)
> new/obj/immortalityfire(M.loc)
> sleep(1)
> M.alpha=0
> sleep(1)
> new/obj/immortality(locate(x,y-2,z))
> sleep(10)
> new/obj/immortalityfire(locate(x,y-2,z))
> sleep(1)
> M.alpha=initial(alpha)
> sleep(1)
> M.loc=(locate(x,y-2,z))
> M.freeze=0
> M.loc=(locate(x,y-2,z))

Which now summons all mobs I added to the list, infront of me, in quick succession, without errors, or lag...

Congrats, a long three-verb Summon. I'm positive it wont create issues when other admins try to summon people >.>
In response to Mightymo
Mightymo wrote:
> for(var/mob/M)
> if(M in SummonList)
>

would be much better as
> for(var/mob/M in SummonList)
>


Totally would.
I'm just going to drop this thread here.
In response to Lige
Lige wrote:
I'm just going to drop this thread here.

Please :)
In response to Lige
L.o.l. I've read that, hilarious read. Very spot on for this topic.
Ssj4 and Lige, so you're saying that going about things differently in code than the both of you, instantly makes anyone and everyone wrong?

I do agree that there might be a more sophisticated, more efficient, and elegant way of doing this. I am still learning however, and what Dreadnaught posted is something I understand better than Ter13.

I am learning step by step, I will be working on a rewritten version more akin to what Ter13 suggested, but part of learning is playing around.

You don't have to agree with me, as much as I don't have to agree with your visions.

If you have a problem with the list being for everyone, is there a way I could make the list specific to that user?
Probably because I started learning dm a whole five days ago. You should strive to optimize the code which in my opinion would have been listening to Ter13 and if you didn't understand something asking specific questions of him to further understand and better yourself. I've probably learned more than you from this topic.
In response to Seijinz
Seijinz wrote:
Ssj4 and Lige, so you're saying that going about things differently in code than the both of you, instantly makes anyone and everyone wrong?

No. Read the thread, your comment makes you a perfect example of the kind of users Tiberath pointed out.

I do agree that there might be a more sophisticated, more efficient, and elegant way of doing this. I am still learning however, and what Dreadnaught posted is something I understand better than Ter13.

Doesn't make it any less wrong. You're learning, great, but you're learning poor methods ( no offense to Dreadnaught ) when Ter has spoon-fed you a more appropriate method.

I am learning step by step, I will be working on a rewritten version more akin to what Ter13 suggested, but part of learning is playing around.

Okay.

You don't have to agree with me, as much as I don't have to agree with your visions.

If you intend on doing things the wrong way, I can direct you to a number of poorly made tutorials and sources.

If you have a problem with the list being for everyone, is there a way I could make the list specific to that user?

Read Ter13's comments in this thread.
In response to Seijinz
Seijinz wrote:
Ssj4 and Lige, so you're saying that going about things differently in code than the both of you, instantly makes anyone and everyone wrong?

I do agree that there might be a more sophisticated, more efficient, and elegant way of doing this. I am still learning however, and what Dreadnaught posted is something I understand better than Ter13.

I am learning step by step, I will be working on a rewritten version more akin to what Ter13 suggested, but part of learning is playing around.

You don't have to agree with me, as much as I don't have to agree with your visions.

If you have a problem with the list being for everyone, is there a way I could make the list specific to that user?


Steps for optimal solution:
/*

1: Create a single verb:

*/


mob/verb/Summon_Players()

/*

2: define a summon List

*/


var/list/myList = list()

/*

3: add mobs to the list

*/


myList += M //Ter shown how to do so, just use a loop to add multiples

/*

4: Pull mobs from your list

*/


for(var/mob/P in myList)

/*

5: manipulate them however you desire

*/


P.loc=src.loc

//you can do what you wish with positioning but for fun.

step_rand(P)



Enjoy.
Page: 1 2 3 4